恒美衍生演示项目

master
chen 2022-04-25 14:38:26 +08:00
commit 994a057f45
227 changed files with 50870 additions and 0 deletions

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
/vendor
/node_modules
/public/storage
/unpackage
/.hbuilderx
Homestead.yaml
Homestead.json
.env
.idea

110
App.vue Normal file
View File

@ -0,0 +1,110 @@
<script>
import toolAll from '@/jsFile/tools.js';
import { themeEv } from '@/jsFile/publicAPI.js';
export default {
globalData:{
outside:true,//,
hostApi:'https://dxscrm.scdxtc.com/',//
latitude:30.656693,//
longitude:104.136425//
},
onLaunch: function() {
console.log(this.globalData.hostApi,12);
//
themeEv();
this.autoUpdate();
//
toolAll.tools.currentContext();
toolAll.tools.isVedio();
},
onShow: function() {
console.log(this.globalData.hostApi,12);
if(uni.getStorageSync('token')) {
toolAll.tools.networkStatus();//
toolAll.tools.refreshToken();//token
}
toolAll.tools.checkQuan(); //
},
onHide: function() {
toolAll.tools.closeTimer();//
if(uni.getStorageSync('token')) {
toolAll.tools.refreshToken();//token
}
uni.removeStorageSync('isQuan');
uni.removeStorageSync('quanImg'); //
uni.removeStorageSync('quanId'); // id
uni.removeStorageSync('isVedio'); //
uni.removeStorageSync('urlparams');
},
methods:{
autoUpdate: function() {
var self = this;
//
if (wx.canIUse('getUpdateManager')) {
const updateManager = wx.getUpdateManager() //1.
updateManager.onCheckForUpdate(function(res) { //
if (res.hasUpdate) {
//
wx.showModal({
title: '更新提示',
content: '检测到新版本,是否下载新版本并重启小程序?',
success: function(res) {
if (res.confirm) {
//2.
self.downLoadAndUpdate(updateManager)
uni.clearStorage();
} else if (res.cancel) {
//
wx.showModal({
title: '温馨提示~',
content: '本次版本更新涉及到新的功能添加,旧版本无法正常访问的哦~',
showCancel:false,//
confirmText:"确定更新",//
success: function(res) {
if (res.confirm) {
//
self.downLoadAndUpdate(updateManager)
console.log(5);
}
}
})
}
}
})
}
})
} else { //
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用该功能,请升级到最新微信版本后重试。'
})
}
},
/**
* 下载小程序新版本并重启应用
* */
downLoadAndUpdate: function (updateManager){
var self = this;
wx.showLoading(); //
updateManager.onUpdateReady(function () {
wx.hideLoading() // applyUpdate
updateManager.applyUpdate()
uni.clearStorage();
})
updateManager.onUpdateFailed(function () { //
wx.showModal({
title: '已经有新版本了哟~',
content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~',
})
})
}
}
};
</script>
<style>
/*每个页面公共css */
@import url("./commons/hengmei.css");
@import url("./commons/animate.min.css");
page {background-color: rgba(244, 244, 244, 1);}
</style>

12
commons/animate.min.css vendored Normal file

File diff suppressed because one or more lines are too long

631
commons/hengmei.css Normal file
View File

@ -0,0 +1,631 @@
/* 首页 */
.status-box{position: fixed;top: 0;left: 0;right: 0;z-index: 10;}
.status-nav{width: 100%;position: relative;padding: 30rpx 0;display: flex;align-items: center;}
.tab-title{font-size: 36rpx;font-weight: bold;color: #333333;width: 100%;}
.tcenter{text-align: center;}
.input-box{width: 100%;}
.input-box>view{background-color: #FFFFFF;margin: 0 40rpx;height: 80rpx;border-radius: 10rpx;padding: 0 17rpx;}
.searchImg{width: 28rpx;height: 28rpx;margin-right: 12rpx;}
.linev{height: 39rpx;border: 2rpx dashed rgba(136, 136, 136, 1);}
.searchT{font-size: 27rpx;margin: 0 23rpx 0 31rpx;}
.gongg-box{width: 25%;color: #2C2C2C;}
.gongg-box .img-box image{width: 108rpx;height: 108rpx;}
.zou> image{height: auto;}
.fawen-img{width: 335rpx;height: 400rpx;}
.fawen-itemImg{height: 190rpx;}
.kitemm{background-color: #E0E0E0;}
.reitem-box{background: #F4F4F4;margin-right: 18rpx;padding: 20rpx;}
.reitem-box>image{width: 20rpx;height: 23rpx;margin-right: 18rpx;}
.reitem{width: 146rpx;height: 65rpx;border-radius: 20rpx;line-height: 65rpx;text-align: center;}
.list-box{width: 48.4%;}
.list-like-box{top: 18rpx;right: 18rpx;z-index: 1;}
.list-like-box>image:first-child {opacity: 0.5;}
.list-like-box>image{width: 69rpx;height: 69rpx;}
.list-cont-box{bottom: 10rpx;left: 0rpx;right: 0; padding-top: 100rpx; background:-webkit-linear-gradient(bottom,rgba(0,0,0,0.79),rgba(255,255,255,0));padding-left: 22rpx;padding-right: 22rpx;padding-bottom: 18rpx;border-bottom-left-radius: 30rpx;border-bottom-right-radius: 30rpx;}
.list-cont-box15{bottom: 8rpx;left: 0rpx;right: 0; padding-top: 100rpx; background:-webkit-linear-gradient(bottom,rgba(0,0,0,0.79),rgba(255,255,255,0));padding-left: 22rpx;padding-right: 22rpx;padding-bottom: 18rpx;border-bottom-left-radius: 15rpx;border-bottom-right-radius: 15rpx;}
.list-headimg{width: 28rpx;height: 28rpx;margin-right: 6rpx;border-radius: 100%;}
.home-quan-box{background: rgba(0,0,0,.54);position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 11;display: flex;justify-content: center;flex-direction: column;align-items: center;}
.home-quan-box image:first-child{width: 542rpx;height: 600rpx;}
.home-quan-box image:last-child{width: 96rpx;height: 96rpx;margin-top: 56rpx;}
.shopKf{position: fixed;right: 16rpx;bottom: 140rpx;z-index: 999;}
/* 分类 */
.catemo{color: #4D4D4D;padding: 20rpx 10rpx;text-align: center;margin-left: 10rpx;}
.cateActive{background-color: #F5F5F5;border-radius: 10rpx 0rpx 0rpx 10rpx;padding: 20rpx 10rpx;text-align: center;margin-left: 10rpx;}
.cate-tu-item{padding: 16rpx 20rpx;background-color: #DFDFDF;}
.cate-box{position: fixed;top: 0;left: 0;bottom: 140rpx;background-color: #FFFFFF;}
.list-min{min-height: 360rpx;}
.cate-box .fon26 .mar-s20:first-child {margin-top: 50rpx;}
/* 搜索 */
.search-input-box{width: 100%;padding-bottom: 20rpx;}
.tank-box{margin: 0 85rpx;}
.tank-box-itemone{font-size: 32rpx;color: #343434;margin: 90rpx 0;}
.tank-btn{width: 240rpx;}
/* 我的页面 */
.icon-box>image:nth-child(1){width: 37rpx;height: 38rpx;}
.icon-box>image:nth-child(2){width: 32rpx;height: 34rpx;}
.icon-box>image:nth-child(3){width: 31rpx;height: 37rpx;}
.icon-box>image:nth-child(4){width: 32rpx;height: 33rpx;}
.icon-box>image:nth-child(5){width: 33rpx;height: 35rpx;}
.icon-box>image:nth-child(6){width: 35rpx;height: 32rpx;}
.icon-box>image:nth-child(7){width: 36rpx;height: 35rpx;}
.sigin-box{position: fixed;top: 50%;left: 50%;transform: translate(-50%,-50%);}
.sigin-box view{padding: 20rpx 40rpx;background-color: rgba(0,0,0,.6);color: #FFFFFF;border-radius: 6rpx;}
.person-m{width: 325rpx;height: 325rpx;margin: 30rpx 86rpx 68rpx 86rpx;}
.close-m{width: 96rpx;height: 96rpx;border-radius: 100%;}
.red-num{width: 36rpx;height: 36rpx;line-height: 36rpx;border-radius: 100%;background: #F96969;right: 50rpx;top: 0;font-size: 22rpx;color: #FFFFFF;text-align: center;}
.icon-img{width: 60rpx;height: 60rpx;}
.white-next{width: 22rpx;height: 22rpx;}
.yuan-box>view{width: 100%;display: flex;justify-content: center;align-items: center;position: relative;}
.yuan-box .xian-right{height: 58rpx;width: 2rpx;background-color: #E6E6E6;right: 0;position: absolute;}
.yuan-box image{width: 54rpx;height: 54rpx;}
.blue-img{position: absolute;top: 0;left: 0;right: 0;height: 436rpx;width: 100%;}
.gao .posia{left: -32rpx;right: -32rpx;z-index: -1;}
.gao .mar-sx30{width:120rpx;height: 120rpx;border-radius: 100%;margin-left: 15rpx;z-index: 1;}
.gao-name{background: #FFBD39;border-radius: 10rpx;text-align: center;font-size: 22rpx;color: #FFFFFF;padding: 5rpx 16rpx;margin-left: 10rpx;}
.gao-phone{width: 14rpx;height: 20rpx;}
.gao-m{width: 43rpx;height: 43rpx;z-index: 1;}
.gao-next-box{width: 50rpx;position: relative;z-index: 1;justify-content: flex-end;}
.gao-next-box image{width: 35rpx;height: 35rpx;z-index: 1;}
/* 病种列表 */
.problem-input{border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;}
/* 暂无内容时,显示的图片大小 */
.zanw-img{width: 474rpx;height: 273rpx;}
/* 修改资料页面 */
.head_img{width: 140rpx;height: 140rpx;border-radius: 100%;}
.nic{color: #101010;}
.head_next{width: 19rpx;height: 19rpx;}
/* 自主预约 */
.xiala{border: 2rpx solid #CECECE;height: 80rpx;line-height: 80rpx;}
.xiala image{width: 35rpx;height: 24rpx;}
.yutime{width: 160rpx;height: 130rpx;}
.timed{width: 210rpx;height: 80rpx;line-height: 80rpx;}
.titlel{width: 18%;}
.titlel2{width: 20%;}
.height-68{height: 80rpx;}
.btnl{margin: 50rpx 80rpx;height: 90rpx;line-height: 90rpx;}
/* 客户列表 */
.xialak{height: 60rpx;line-height: 60rpx;border: 2rpx solid #E0E0E0;}
.xialak image{width: 35rpx;height: 24rpx;}
.customer-btn{height: 60rpx;width: 143rpx;line-height: 60rpx;}
/* 医生 */
.qdoctor:before{
content: '';
display: block;
width: 10rpx;height: 40rpx;
border-radius: 10rpx;
background-color: #3875F6;
margin-right: 10rpx;
}
.doctoritem:before{
content: '';
display: block;
height: 20rpx;
border-radius: 10rpx;
border: 4rpx solid #3875F6;
background-color: #3875F6;
margin-right: 6rpx;
}
/* .zhuan{transition: all 1s;transform: rotate(90deg);} */
.nozhuan{transition: all 1s;transform: rotate(0deg);}
.xial-box{top: 80rpx;left: 0;right: 0;z-index: 4;border: 2rpx solid #E0E0E0;}
.xial-item-box{max-height: 400rpx;overflow-y: scroll; overflow-x: hidden;}
.doctorx{margin: 0 15rpx;height: 18rpx;border: 2rpx solid #E6E6E6;}
.doctorImg{width: 100%;
/* height: 285rpx; */
height: 480rpx;
border-top-left-radius: 10rpx;border-top-right-radius: 10rpx;}
.isTop{background-color: #FFFFFF;box-shadow: 0rpx 3rpx 10rpx rgba(0,0,0,.6);}
.isTops{position: sticky;left: 0;right: 0;z-index: 2;}
.isTopf{position: fixed;left: 0;right: 0;z-index: 2;}
/* 底部联系客服、分享、返回首页 */
.btnBKS{height: 120rpx;}
.lianShare{height: 90rpx;width: 220rpx;}
.backH{width: 190rpx;height: 190rpx;top: -126rpx;}
.addCart-btn{border-top-left-radius: 51rpx;border-bottom-left-radius: 51rpx;background-color: #3875F6;}
.mai-btn{border-top-right-radius: 51rpx;border-bottom-right-radius: 51rpx;background-color: #F85050;}
/* 商城 */
.shop-nav-box input{border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;}
.shop-nav-box>view:first-child view,.jf-input-box>view:first-child view{height: 80rpx;line-height: 80rpx;}
.shop_list_box>view>view:last-child{margin-bottom: 200rpx;}
.shop-nav-box .pad-zy50 view:nth-child(n+2){background: #3875F6;color: #FFFFFF;border-radius: 30rpx;padding: 8rpx 20rpx;font-size: 24rpx;display: flex;align-items: center;margin-right: 20rpx;margin-top: 30rpx;}
.shop-nav-box .mar-s40{height: 60rpx;border: 2rpx solid #E0E0E0;border-radius: 10rpx;width: 100%;box-sizing: border-box;padding-left: 20rpx;font-size: 24rpx;}
.shop-nav-box .mar-x30 view{font-size: 28rpx;width: 294rpx;height: 60rpx;border-radius: 10rpx;text-align: center;line-height: 60rpx; }
.shop-nav-box .mar-x30 view:first-child{background: #E6E6E6;color: #4D4D4D;}
.shop-nav-box .mar-x30 view:last-child{background: #3875F6;color: #FFFFFF;}
.activebcate,.shopBMo{border-radius: 20rpx;background-color: #f2f2f2;color: #333333;padding: 12rpx 24rpx;}
.activebcate{color: #FFFFFF;}
.jf-input-box input{border: 2rpx solid #E0E0E0;padding: 0rpx 20rpx;height: 80rpx;line-height: 80rpx;}
.jf-input-box image{width: 16rpx;height: 13rpx;}
.jf-input-box image:last-child{margin-top: 4rpx;}
.cart-box{position: fixed;right: 30rpx;bottom: 200rpx;}
.cart-box .posir,.cart-box .posir image,.detail-cart-box .posir,.detail-cart-box .posir image{width: 112rpx;height: 112rpx;}
.cart-box .posia,.detail-cart-box .posia{background: #F85050;width: 36rpx;height: 36rpx;line-height: 36rpx;border-radius: 100%;color: #FFFFFF;font-size: 24rpx;text-align: center;top: 20rpx;right: 20rpx;}
.cart-box .posia view,.detail-cart-box .posia view{transform: scale(.8);}
.moban{background: rgba(0,0,0,.54);width: 100%;position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 2;}
.detail-cart-box{position: fixed;right: 30rpx;bottom: 300rpx;z-index: 999;}
/* 商品详情 */
.activelei,.molei{border-radius: 20rpx;padding: 10rpx 24rpx;color: #333333;margin-left: 20rpx;}
.activelei{color: #FFFFFF;}
.shop-title-box view{display: inline-block;float: left;}
.shop-title-box view span{padding: 6rpx 10rpx;}
.shop-title-box view span:nth-child(n+2){background: #F85050;}
.shop-price{color: #F85050;font-size: 40rpx;font-weight: bold;}
.shop-price span:last-child{color: #B3B3B3;font-size: 24rpx;text-decoration: line-through;font-weight: 400;margin-left: 20rpx;}
.yuan-price{color: #B3B3B3;font-size: 24rpx;text-decoration: line-through;font-weight: 400;}
.shar-box{margin-top: -20rpx;padding-bottom: 20rpx;}
.shar-box>view:first-child image{width: 42rpx;height: 30rpx;}
.shop-swiper{height: 280rpx;padding-top: 20rpx;}
.big-img{width: 70rpx;height: 70rpx; border-radius: 100%;}
.shop-swiper .bold{width: 140rpx;height: 80rpx;line-height: 80rpx;text-align: center;background: #F85050;border-radius: 20rpx;}
.duan-xian{border-bottom: 2rpx solid #E6E6E6;position: absolute;bottom: 0;width: 87%;right: 0;}
.bottom-popu,.order-cancle-tk{border-radius: 40rpx 40rpx 0rpx 0rpx;}
.bottom-popu>view:first-child image{width: 214rpx;height: 214rpx;border-radius: 15rpx;bottom: 0;flex-shrink: 0;margin-top: -107rpx;margin-right: 30rpx;}
.bottom-popu>view:first-child .width100 image{width: 24px;height: 24px;margin-top: -20rpx;}
.del-btn,.add-btn{width: 65rpx;height: 30px;}
.num-input{width: 80rpx;height: 28px;text-align: center;border-top: 2rpx solid #3875F6;border-bottom: 2rpx solid #3875F6;}
.ev-btn{width: 294rpx;height: 80rpx;line-height: 80rpx;text-align: center;border-radius: 10rpx;}
.pd-tk-box{position: fixed;top: 0;left: 0;right: 0;bottom: 0;z-index: 6;background: rgba(0,0,0,.54);display: flex;justify-content: center;align-items: center;}
.pd-tk-box .posir{font-weight: 500;text-align: center;margin: 0 85rpx;height: 458rpx;}
.pd-tk-box .posir view:nth-child(1){margin: 34rpx 0 27rpx 0;}
.pd-tk-box .posir view:nth-child(2){margin-bottom: 63rpx;}
.pd-tk-box .posir view:nth-child(3){margin-bottom: 77rpx;}
.pd-tk-box .posir view:nth-child(3) image:nth-child(1),.pd-tk-box .posir view:nth-child(3) image:nth-child(3){width: 100rpx;height: 100rpx;border-radius: 100%;}
.pd-tk-box .posir view:nth-child(3) image:nth-child(2){width: 42rpx;height: 42rpx;margin: 0 47rpx;}
.pd-tk-box .posir view:nth-child(4){width: 464rpx;height: 60rpx;line-height: 60rpx;color: #FFFFFF;background: #F85050;border-radius: 10rpx;margin: 0 auto;font-size: 28rpx;}
.pd-tk-box .posir>image{width: 77rpx;height: 77rpx;right: -30rpx;top: -30rpx;}
swiper-item view:last-child .duan-xian{border-bottom: none;}
.score-box{width: 100%;height: 90rpx;line-height: 90rpx;padding-left: 62rpx;background: #3875F6;color: #FFFFFF;font-size: 40rpx;font-weight: bold;}
/* 准备下单 */
.activeT,.expressT{width: 124rpx;height: 60rpx;line-height: 60rpx;text-align: center;margin-left: 20rpx;border-radius: 20rpx;}
.activeT{color: #FFFFFF;}
.activeQuan::before{content: '';display: block;width: 50%;height: 8rpx;background: #3875F6;position: absolute;bottom: -20rpx;left: 50%;transform: translateX(-50%);}
.xiaDan-next{width: 16px;height: 16px;flex-shrink: 0;}
.there{width: 90rpx;height: 86rpx;flex-shrink: 0;}
.order-image{width: 166rpx;height: 166rpx;border-radius: 15rpx;margin-right: 12rpx;}
.order-sy{font-size: 22rpx;color: #808080;font-weight: 500;margin-top: 6rpx;}
.order-item-price{color: #F85050;font-size: 32rpx;font-weight: bold;}
.goPayment{color: #FFFFFF;font-size: 28rpx;font-weight: bold;width: 170rpx;height: 70rpx;line-height: 70rpx;text-align: center;background: #3875F6;border-radius: 35rpx;margin-left: 10rpx;}
.quan-item-box{height: 200rpx;}
.quan-item-box>view:first-child{width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;}
.quan-item-box>view:first-child image{width: 218rpx;height: 200rpx;left: 0;top: 0;}
.quan-item-box>view:last-child{display: flex;flex-direction: column;justify-content: space-between;width: 100%;height: 200rpx;padding: 0 20rpx;background-color: #F5F5F5;}
.quan-item-box>view:last-child image{float: right;}
.quan-list-box{max-height: 600rpx;}
.quan-list-box .mar-x40:last-child{margin-bottom: 0rpx;}
.ling-btn{font-size: 36rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 20rpx;height: 90rpx;line-height: 90rpx;text-align: center;margin-top: 156rpx;margin-bottom: 20rpx;}
.zhun-dui-box{display: flex;justify-content: center;align-items: center;padding: 0 85rpx;}
.zhun-dui-btn view{width: 196rpx;height: 60rpx;line-height: 60rpx;text-align: center;font-size: 28rpx;font-weight: 500;border-radius: 10rpx;color: #FFFFFF;}
.zhun-dui-btn view:first-child{background: #C8C8C8;}
.zhun-dui-btn view:last-child{background: #3875F6;}
.success-box{padding: 27rpx 20rpx;text-align: center;}
.success-box image{width: 194rpx;height: 194rpx;}
.success-hj{font-size: 46rpx;margin-bottom: 120rpx;color: #F85050;}
/* 立即支付页面 */
.chooseDX,.quan-item-box>view:last-child image{width: 40rpx;height: 40rpx;border-radius: 100%;}
.dao-box{padding: 55rpx 0 64rpx 0;text-align: center;}
.submit-pay{margin: 0 auto;color: #FFFFFF;font-weight: bold;font-size: 36rpx;text-align: center;width: 546rpx;height: 90rpx;line-height: 90rpx;background-color: #3875F6;border-radius: 20rpx;}
.success-btn{margin-bottom: 150rpx;}
.success-btn view{width: 244rpx;height: 70rpx;border-radius: 10rpx;text-align: center;line-height: 70rpx;}
.success-btn view:first-child{background: #E9E9E9;color: #333333;}
/* 购物车页面 */
.edit-btn{width: 113rpx;height: 43rpx;border-radius: 20rpx;background: #3875F6;text-align: center;color: #FFFFFF;line-height: 43rpx;}
.cart-list-box{overflow: hidden;}
.cart-input-box{border-radius: 4rpx;overflow: hidden;}
.cart-input-box image{width: 46rpx;height: 26px;}
.cart-input-box input{width: 60rpx;height: 24px;text-align: center;border-top: 2rpx solid #3875F6;border-bottom: 2rpx solid #3875F6;}
.goBuy-btn{width: 200rpx;height: 80rpx;line-height: 80rpx;text-align: center;border-radius: 35rpx;}
.chooseAll-box{width: 40rpx;height: 40rpx;border-radius: 100%;border: 2rpx solid #3875F6;flex-shrink: 0;display: flex;justify-content: center;align-items: center;}
.chooseAll-box view{width: 24rpx;height: 24rpx;background-color: #3875F6;border-radius: 100%;}
.item-del-btn{width: 117rpx;height: 205rpx;background: #F85050;line-height: 205rpx;text-align: center;color: #FFFFFF;font-size: 24rpx;flex-shrink: 0;position: absolute;right: 0;bottom: 40rpx;top: 2rpx;}
/* 我的订单页面 */
.order-item-box image{width: 166rpx;height: 166rpx;border-radius: 15rpx;margin-right: 12rpx;}
.order-btn{width: 210rpx;height: 75rpx;line-height: 75rpx;text-align: center;border-radius: 10rpx;background: #F85050;color: #FFFFFF;margin-left: 45rpx;}
.order-cancle{width: 210rpx;height: 75rpx;line-height: 75rpx;text-align: center;border-radius: 10rpx;background: #E9E9E9;color: #808080;}
.heyan-close{width: 96rpx;height: 96rpx;left: 50%;transform: translateX(-50%);bottom: -150rpx;}
.confirm-btn{font-size: 36rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 20rpx;height: 90rpx;line-height: 90rpx;text-align: center;margin: 80rpx 100rpx 20rpx 100rpx;}
/* 地址管理页面 */
.address_active{width: 40rpx;height: 40rpx;}
.address_add{font-size: 30rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 20rpx;height: 90rpx;line-height: 90rpx;text-align: center;margin: 0 93rpx;}
.xiao-sanj image{width: 14rpx;height: 11rpx;}
.xiao-sanj image:last-child{margin-top: 4rpx;}
.address-btn-add{font-size: 30rpx;color: #FFFFFF;font-weight: bold;margin: 0 auto;background: #3875F6;border-radius: 20rpx;height: 90rpx;line-height: 90rpx;text-align: center;margin: 80rpx 76rpx 20rpx 76rpx;}
.address-close-btn{width: 77rpx;height: 77rpx;right: -55rpx;top: -36rpx;}
.info-box{background: #fff;left: 0;right: 0;top: 52rpx;height: 0rpx;transition: all 0.5s;border: 2rpx solid #E6E6E6;opacity: 0; z-index: 6;overflow: hidden;overflow-y: scroll;color: #666;}
.info-box view{margin: 10rpx;font-size: 24rpx;}
.dong {height: 200rpx;border: 2rpx solid #E6E6E6;opacity: 1;}
/* 优惠券页面 */
.quan-btn{width: 136rpx;height: 48rpx;line-height: 48rpx;text-align: center;border-radius: 30rpx;background: #FFFFFF;color: #3875F6;margin-right: -10rpx;}
.quan-img{width: 218rpx;height: 200rpx;left: 0;top: 0;}
.quan-right-box{display: flex;flex-direction: column;justify-content: space-between;width: 100%;height: 200rpx;padding: 0 20rpx;background-color: #FFFFFF;}
.quan-use{width: 94rpx;height: 94rpx;right: 20rpx;top: 20rpx;}
.quan-tk-box{position: fixed;top: 0;left: 0;bottom: 0;right: 0;background: rgba(0,0,0,.54);z-index: 3;}
.quan-tk-btn{width: 96rpx;height: 96rpx;left: 50%;transform: translateX(-50%);bottom: -150rpx;}
.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;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;}
.imgIng{width: 340rpx;height: 348rpx;border-radius: 10rpx;margin-bottom: 70rpx;}
.task-add-box{width: 340rpx;height: 348rpx;background: #F0F0F0;border-radius: 10rpx;margin-bottom: 70rpx;}
.task-add{width: 100rpx;height: 6rpx;background: #B3B3B3;border-radius: 10rpx;}
/* 签到页面 */
.sigin-img{width: 218rpx;height: 202rpx;margin: 0 auto;}
.sigin-success{width: 31rpx;height: 30rpx;margin-top: 20rpx;}
.sigin-day{width: 66rpx;height: 66rpx;border-radius: 100%;border: 2rpx solid #FFFFFF;}
.sigin-day image{width: 27rpx;height: 27rpx;border-radius: 100%;border: 1rpx solid #759FFD;text-align: center;line-height: 27rpx;color: #759FFD;background: #FFFFFF;font-size: 20rpx;right: 0rpx;bottom: -8rpx;}
/* 孔雀币页面 */
.coin-tx-btn{width: 152rpx;height: 60rpx;line-height: 60rpx;text-align: center;color: #FFFFFF;background: #3875F6;border-radius: 30rpx;font-size: 26rpx;}
.coin-yuan{font-size: 26rpx;font-weight: 400;}
.coin-miao{height: 60rpx;line-height: 60rpx;}
.coin-share-box{width: 588rpx;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 20rpx;background: #38CE51;position: fixed;bottom: 76rpx;left: 50%;transform: translateX(-50%);}
.coin-share-box image {width: 50rpx;height: 50rpx;}
.tx-tk-box{position: fixed;top: 0;left: 0;bottom: 0;right: 0;background: rgba(0,0,0,.54);}
.tx-tk-box input{border: 2rpx solid #E0E0E0;margin-bottom: 80rpx;height: 60rpx;}
.tk-btn{width: 196rpx;height: 60rpx;line-height: 60rpx;text-align: center;border-radius: 10rpx;font-size: 28rpx;color: #FFFFFF;}
.tk-btn:last-child{background-color: #C8C8C8;}
/* 我的订单页面 */
.order-hx-img{width: 325rpx;height: 325rpx;}
.order-close-btn{width: 40rpx;height: 40rpx;right: 50rpx;top: 20rpx;}
/* 订单详情 */
.orderInfo-btn{width: 249rpx;height: 70rpx;border-radius: 35rpx;line-height: 70rpx;text-align: center;font-size: 28rpx;font-weight: bold;background: #3875F6;color: #FFFFFF;margin-left: 20rpx;}
.paid-btn-box view{width: 249rpx;height: 70rpx;border-radius: 35rpx;line-height: 70rpx;text-align: center;font-size: 28rpx;font-weight: bold;}
.paid-btn-box view:first-child{background: #E9E9E9;color: #808080;}
.paid-btn-box view:last-child{background: #3875F6;color: #FFFFFF;margin-left: 20rpx;}
.consumption-box{margin: 40rpx 0 40rpx 0;text-align: right;}
.orderDetail-box{padding: 0rpx 20rpx 27rpx 20rpx;}
.orderDetail-box image{width: 166rpx;height: 166rpx;border-radius: 15rpx;margin-right: 12rpx;}
.orderDetail-sku{font-size: 22rpx;color: #808080;font-weight: 500;}
.orderDetail-bottom-box{height: 124rpx;padding: 0 32rpx;display: flex;align-items: center;border-top: 2rpx solid #F5F5F5;}
.orderDetail-bottom-box image{width: 56rpx;height: 56rpx;}
/* 积分管理页面 */
.score-img{width: 108rpx;height: 108rpx;flex-shrink: 0;}
.score-people-box{display: flex;justify-content: space-between;flex-direction: column;height: 108rpx;}
.score-sigin-btn{width: 140rpx;height: 40rpx;line-height: 40rpx;text-align: center;color: #FFFFFF;background: #F6C338;border-radius: 30rpx;font-size: 24rpx;font-weight: 400;}
.score-share-box{width: 588rpx;height: 90rpx;line-height: 90rpx;text-align: center;border-radius: 20rpx;background: #38CE51;position: fixed;bottom: 76rpx;left: 50%;transform: translateX(-50%);}
.score-share-box image{width: 50rpx;height: 50rpx;}
/* 消息页面 */
.message-img{width:46rpx;height:56rpx;}
.message-status{border-radius: 5rpx;font-size: 24rpx;color: #FFFFFF;padding: 2rpx 8rpx 4rpx 6rpx;transform: scale(.8);}
/* 我的日记 */
.diary-img{margin-right: 13rpx;width: 32%; height: 212rpx;background-color: #F5F5F5;border-radius: 12rpx;}
.diary-img:nth-child(3n){
margin-right: 0;
}
.diary-item-img {
width: 32%;height: 168rpx;border-radius: 10rpx;
margin-right: 10rpx;
margin-bottom: 10rpx;
}
.diary-item-img .addImg {
height: 168rpx;width: 100%;border-radius: 10rpx;
}
.diary-item-img:nth-child(3n){
margin-right: 0;
}
@media screen and (height:568px){
.blue-img{height: 471rpx;}
}
@media screen and (height:640px){
.blue-img{height: 450rpx;}
}
@media screen and (height:667px){
.blue-img{height: 450rpx;}
}
@media screen and (height:731px){
.blue-img{height: 426rpx;}
}
@media screen and (height:736px){
.blue-img{height: 430rpx;}
}
@media screen and (width:375px) and (height:736px){
.blue-img{height: 444rpx;}
}
@media screen and (height:800px){
.blue-img{height: 406rpx;}
}
@media screen and (height:812px){
.blue-img{height: 500rpx;}
}
@media screen and (height:823px){
.blue-img{height: 440rpx;}
}
@media screen and (height:844px){
.blue-img{height: 496rpx;}
}
@media screen and (height:896px){
.blue-img{height: 478rpx;}
}
@media screen and (min-height:926px){
.blue-img{height: 476rpx;}
}
/* @media screen and (height:812px){
.blue-img{height: 500rpx;}
}
@media screen and (height:844px){
.blue-img{height: 496rpx;}
}
@media screen and (height:896px){
.blue-img{height: 486rpx;}
}
@media screen and (min-height:926px){
.blue-img{height: 490rpx;}
} */
.bottoc{margin-top: 6rpx;color: #414141;}
.text2 {text-indent: 2rem;}
.opc{opacity: 0.7;}
.width100{width: 100%;}
.width55{width: 55%;}
.width50{width: 50%;}
.width48{width: 48%;}
.width45{width: 45%;}
.width33{width: 33%;}
.width25{width: 25%;}
.posAll{position: fixed;top: 0;left: 0;right: 0;bottom: 0;background-color: rgba(0,0,0,.45);z-index: 12;}
.posir{position: relative;}
.posia{position: absolute;}
.poszy{position: fixed;left: 0;right: 0;z-index: 3;}
.posiszy{position: fixed;left: 0;right: 0;z-index: 5;}
.posixzy{position: fixed;left: 0;right: 0;z-index: 2;bottom: 0;}
.posia-op{position: absolute;top: 0;right: 0;left: 0;bottom: 0;opacity: 0;}
.syxzo{top: 0;left: 0;right: 0;bottom: 0;opacity: 0;}
.dis{display: flex;}
.disac{display: flex;align-items: center;}
.disja{display: flex;justify-content: space-around;}
.disjb{display: flex;justify-content: space-between;}
.disje{display: flex;justify-content: flex-end;}
.disjbac{display: flex;justify-content: space-between;align-items: center;}
.disjcac{display: flex;justify-content: center;align-items: center;}
.fc{flex-direction: column;}
.fw{flex-wrap: wrap;}
.fe{justify-content: flex-end;}
.flexs{flex-shrink: 0;}
.wh42{width: 42rpx;height: 42rpx;}
.wh44{width: 44rpx;height: 44rpx;}
button:after{content: none!important;}
.borbot{border-bottom: 2rpx solid #E6E6E6;}
.borbot:last-child{border-bottom: none;}
.bbot{border-bottom: 2rpx solid #E6E6E6;}
.borbot-df{border: 2rpx solid #DFDFDF;}
.borbot-cc{border: 2rpx solid #CCCCCC;}
.line-h50{line-height: 50rpx;}
.clips1{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 1;overflow: hidden;text-overflow: ellipsis;word-wrap: break-word;word-break:break-all;}
.clips2{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 2;overflow: hidden;text-overflow: ellipsis;word-wrap: break-word;word-break:break-all;}
.clips3{display: -webkit-box;-webkit-box-orient: vertical;-webkit-line-clamp: 3;overflow: hidden;text-overflow: ellipsis;word-wrap: break-word;word-break:break-all;}
/* 字体大小 */
.fon20{font-size: 20rpx;}
.fon24{font-size: 24rpx;}
.fon25{font-size: 25rpx;}
.fon26{font-size: 26rpx;}
.fon27{font-size: 27rpx;}
.fon28{font-size: 28rpx;}
.fon30{font-size: 30rpx;}
.fon32{font-size: 32rpx;}
.fon34{font-size: 34rpx;}
.fon36{font-size: 36rpx;}
.fon38{font-size: 38rpx;}
.fon40{font-size: 40rpx;}
.fon56{font-size: 56rpx;}
/* 字体颜色 */
.colf{color: #FFFFFF;}
.colb{color: #000000;}
.colc{color: #CCCCCC;}
.col3{color: #333333;}
.col34{color: #343434;}
.col6{color: #666666;}
.colf8{color: #F85050;}
.col9{color: #999999;}
.pcol{color: #3875F6;}
.col2c{color: #2C2C2C;}
.col80{color: #808080;}
.col7D{color: #7D7D7D;}
.colB3{color: #B3B3B3;}
.col5b{color: #5B5B5B;}
/* 字体位置 */
.tc{text-align: center;}
.tright{text-align: right;}
/* 行间距 */
.linh40{line-height: 40rpx;}
/* 粗体 */
.bold{font-weight: bold;}
.font5{font-weight: 500;}
.font4{font-weight: 400;}
/* 背景颜色 */
.pbackc{background-color: #3875F6;}
.bacf{background-color: #FFFFFF;}
.bcdb{background-color: #DBDBDB;}
.bcf8{background: #F85050;}
.bacf5{background: #F5F5F5;}
/* 圆角 */
.radius10{border-radius: 10rpx;}
.radius15{border-radius: 15rpx;}
.radius20{border-radius: 20rpx;}
.radius30{border-radius: 30rpx;}
.radius35{border-radius: 35rpx;}
.radius40{border-radius: 40rpx;}
.radius45{border-radius: 45rpx;}
/* 上下左右---外边距 */
.mar10{margin: 10rpx;}
.mar20{margin: 20rpx;}
.mar25{margin: 25rpx;}
.mar30{margin: 30rpx;}
.mar32{margin: 32rpx;}
.mar36{margin: 36rpx;}
.mar40{margin: 40rpx;}
.mar50{margin: 50rpx;}
/* 上下---外边距 */
.mar-sx10{margin-top: 10rpx;margin-bottom: 10rpx;}
.mar-sx20{margin-top: 20rpx;margin-bottom: 20rpx;}
.mar-sx25{margin-top: 25rpx;margin-bottom: 25rpx;}
.mar-sx30{margin-top: 30rpx;margin-bottom: 30rpx;}
.mar-sx32{margin-top: 32rpx;margin-bottom: 32rpx;}
.mar-sx36{margin-top: 36rpx;margin-bottom: 36rpx;}
.mar-sx40{margin-top: 40rpx;margin-bottom: 40rpx;}
.mar-sx50{margin-top: 50rpx;margin-bottom: 50rpx;}
/* 左右---外边距 */
.mar-zy10{margin-left: 10rpx;margin-right: 10rpx;}
.mar-zy20{margin-left: 20rpx;margin-right: 20rpx;}
.mar-zy25{margin-left: 25rpx;margin-right: 25rpx;}
.mar-zy30{margin-left: 30rpx;margin-right: 30rpx;}
.mar-zy32{margin-left: 32rpx;margin-right: 32rpx;}
.mar-zy36{margin-left: 36rpx;margin-right: 36rpx;}
.mar-zy40{margin-left: 40rpx;margin-right: 40rpx;}
.mar-zy50{margin-left: 50rpx;margin-right: 50rpx;}
.mar-zy85{margin-left: 85rpx;margin-right: 85rpx;}
/* 上---外边距 */
.mar-s10{margin-top: 10rpx;}
.mar-s20{margin-top: 20rpx;}
.mar-s25{margin-top: 25rpx;}
.mar-s30{margin-top: 30rpx;}
.mar-s32{margin-top: 32rpx;}
.mar-s36{margin-top: 36rpx;}
.mar-s40{margin-top: 40rpx;}
.mar-s50{margin-top: 50rpx;}
/* 下---外边距 */
.mar-x10{margin-bottom: 10rpx;}
.mar-x20{margin-bottom: 20rpx;}
.mar-x25{margin-bottom: 25rpx;}
.mar-x30{margin-bottom: 30rpx;}
.mar-x32{margin-bottom: 32rpx;}
.mar-x36{margin-bottom: 36rpx;}
.mar-x40{margin-bottom: 40rpx;}
.mar-x50{margin-bottom: 50rpx;}
/* 左---外边距 */
.mar-z10{margin-left: 10rpx;}
.mar-z20{margin-left: 20rpx;}
.mar-z25{margin-left: 25rpx;}
.mar-z30{margin-left: 30rpx;}
.mar-z32{margin-left: 32rpx;}
.mar-z36{margin-left: 36rpx;}
.mar-z40{margin-left: 40rpx;}
.mar-z50{margin-left: 50rpx;}
/* 右---外边距 */
.mar-y10{margin-right: 10rpx;}
.mar-y20{margin-right: 20rpx;}
.mar-y25{margin-right: 25rpx;}
.mar-y30{margin-right: 30rpx;}
.mar-y32{margin-right: 32rpx;}
.mar-y36{margin-right: 36rpx;}
.mar-y40{margin-right: 40rpx;}
.mar-y50{margin-right: 50rpx;}
/* 上下左右---内边距 */
.pad10{padding: 10rpx;}
.pad20{padding: 20rpx;}
.pad25{padding: 25rpx;}
.pad30{padding: 30rpx;}
.pad32{padding: 32rpx;}
.pad36{padding: 36rpx;}
.pad40{padding: 40rpx;}
.pad50{padding: 50rpx;}
/* 上下---内边距 */
.pad-sx10{padding-top: 10rpx;padding-bottom: 10rpx;}
.pad-sx20{padding-top: 20rpx;padding-bottom: 20rpx;}
.pad-sx25{padding-top: 25rpx;padding-bottom: 25rpx;}
.pad-sx30{padding-top: 30rpx;padding-bottom: 30rpx;}
.pad-sx32{padding-top: 32rpx;padding-bottom: 32rpx;}
.pad-sx36{padding-top: 36rpx;padding-bottom: 36rpx;}
.pad-sx40{padding-top: 40rpx;padding-bottom: 40rpx;}
.pad-sx50{padding-top: 50rpx;padding-bottom: 50rpx;}
/* 左右---内边距 */
.pad-zy10{padding-left: 10rpx;padding-right: 10rpx;}
.pad-zy20{padding-left: 20rpx;padding-right: 20rpx;}
.pad-zy25{padding-left: 25rpx;padding-right: 25rpx;}
.pad-zy30{padding-left: 30rpx;padding-right: 30rpx;}
.pad-zy32{padding-left: 32rpx;padding-right: 32rpx;}
.pad-zy36{padding-left: 36rpx;padding-right: 36rpx;}
.pad-zy40{padding-left: 40rpx;padding-right: 40rpx;}
.pad-zy50{padding-left: 50rpx;padding-right: 50rpx;}
/* 上---内边距 */
.pad-s10{padding-top: 10rpx;}
.pad-s20{padding-top: 20rpx;}
.pad-s25{padding-top: 25rpx;}
.pad-s30{padding-top: 30rpx;}
.pad-s32{padding-top: 32rpx;}
.pad-s36{padding-top: 36rpx;}
.pad-s40{padding-top: 40rpx;}
.pad-s50{padding-top: 50rpx;}
/* 下---内边距 */
.pad-x10{padding-bottom: 10rpx;}
.pad-x20{padding-bottom: 20rpx;}
.pad-x25{padding-bottom: 25rpx;}
.pad-x30{padding-bottom: 30rpx;}
.pad-x32{padding-bottom: 32rpx;}
.pad-x36{padding-bottom: 36rpx;}
.pad-x40{padding-bottom: 40rpx;}
.pad-x50{padding-bottom: 50rpx;}
.pad-x160{padding-bottom: 160rpx;}
.pad-x180{padding-bottom: 180rpx;}
.pad-x260{padding-bottom: 260rpx;}
/* 左---内边距 */
.pad-z10{padding-left: 10rpx;}
.pad-z20{padding-left: 20rpx;}
.pad-z25{padding-left: 25rpx;}
.pad-z30{padding-left: 30rpx;}
.pad-z32{padding-left: 32rpx;}
.pad-z36{padding-left: 36rpx;}
.pad-z40{padding-left: 40rpx;}
.pad-z50{padding-left: 50rpx;}
/* 右---内边距 */
.pad-y10{padding-right: 10rpx;}
.pad-y20{padding-right: 20rpx;}
.pad-y25{padding-right: 25rpx;}
.pad-y30{padding-right: 30rpx;}
.pad-y32{padding-right: 32rpx;}
.pad-y36{padding-right: 36rpx;}
.pad-y40{padding-right: 40rpx;}
.pad-y50{padding-right: 50rpx;}
.pad-sx27-zy20{padding: 27rpx 20rpx;}

View File

@ -0,0 +1,256 @@
<template>
<view v-if="showAuth">
<!-- 用户信息授权 -->
<view v-if="showUserInfo" @touchmove.stop.prevent="moveHandle" :class="isAnimation==2?'card-box-userinfo':''" class="auth-box">
<view :class="isAnimation==1?'card-box-userinfo':''">
<view class="auth-top">
<image :src="appletImg" mode=""></image>
<view class="auth-top-content">
<view>xxx客服代表提醒您</view>
<view>您当前是游客身份</view>
<view>是否选择授权登录</view>
</view>
</view>
<view class="auth-center">为了给您提供更好的服务向您申请微信头像及昵称授权</view>
<view class="auth-bottom">
<view @tap="chooseBtn" :class="noAuthBtn?'isNyin':'noyin'" class="btn btn-no">暂不授权</view>
<view :class="yesAuthBtn?'isOyin':'noyin'" class="btn btn-yes">
<text>立即授权</text>
<button @tap="authEv" class="auth-btn">立即授权</button>
</view>
</view>
</view>
</view>
<!-- 手机号授权 -->
<view v-if="showMobile" @touchmove.stop.prevent="moveHandle" class="disjcac posAll" style="z-index: 1001;">
<view class="bacf radius20 width100 tank-box">
<view class="tc tank-box-itemone">请授权绑定手机号</view>
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
<view class="pad-sx20 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
<view class="pad-sx20 radius10 tank-btn posir pbackc">
立即绑定
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {reportBuriedPoint} from '@/jsFile/publicAPI.js';
export default {
name:"auth-userInfo-mobileInfo",
props:{
optionObj:{//
type:Object,
default:()=>{
return {}
}
},
// appletImg:{//
// type:String,
// default:'/static/public/like.png'
// },
appletName:{//
type:String,
default:''
}
},
data() {
return {
yesAuthBtn:false, //
noAuthBtn:false, //
isAnimation:0, //
showAuth:false, //
currentPage:'', //
showMobile:true ,//
showUserInfo:false,
flag:true,
appletImg:''//logo
};
},
destroyed() {
console.log('清除路径缓存');
uni.removeStorageSync('urlparams');
},
mounted() {
this.appletImg = uni.getStorageSync('appletImg');
//
let pages = getCurrentPages(); //
let currentPage = pages[pages.length - 1]; //
// console.log(currentPage.route,'');
console.log(currentPage.$page.fullPath,'获取当前页面完整路径带参数');
// console.log(currentPage.options,'');
uni.setStorageSync('urlparams',currentPage.$page.fullPath);
if(uni.getStorageSync('token')=='' || uni.getStorageSync('phone_active')==0 || uni.getStorageSync('is_active')==0){
this.loginEv(currentPage.options);
}
let pagesArr = getCurrentPages();
// console.log(pagesArr.length,'');
if(pagesArr.length==1) {
uni.setStorageSync('outside',6);
}
},
methods:{
loginEv(data){
uni.login({
provider: 'weixin',
success: (res)=> {
if (res.code) {
var params = {
code: res.code,
invite_code: data.invite_code || '', //
source_code: data.source_code || '', //
channel: data.channel || ''
}
uni.request({
url: `${getApp().globalData.hostApi}user/login`,
method: 'GET',
data: params,
success: res => {
if(res.data.data.token!=''){
uni.setStorageSync('token',res.data.data.token); // token
uni.setStorageSync('openid',res.data.data.openid)//openid
uni.setStorageSync('expire',res.data.data.expire); //
uni.setStorageSync('phone_active',res.data.data.phone_active); //
uni.setStorageSync('is_active',res.data.data.is_active)//
if(res.data.data.phone_active==0 || res.data.data.is_active==0) {
this.showAuth = true;
this.$requst.post('user/first-enter',{openid:res.data.data.openid,path:uni.getStorageSync('urlparams')}).then(res=>{})
} else {
uni.reLaunch({ //
url:uni.getStorageSync('urlparams')
})
}
}
},
})
//
// this.$requst.post('user/login',params).then(res => {
// if(res.code==0){console.log(params,101);} else this.$toolAll.tools.showToast(res.msg);
// },error => {
// // this.$toolAll.tools.showToast(error.msg);
// // setTimeout(()=>{
// // uni.navigateTo({url:'/pages/login/login'})
// // },2000)
// })
}
},
});
},
//
moveHandle(){
return false
},
chooseBtn(){//
this.noAuthBtn = true;
},
authEv(){//
if(this.flag) {
this.flag = false;
this.$toolAll.tools.showToast('正在调起授权...');
this.yesAuthBtn = true;
uni.getUserProfile({//
desc: '登录',
lang: 'zh_CN',
success: (res) => {
uni.login({// code
provider: 'weixin',
success: (result)=> {
uni.hideToast()
//
this.updateUserInfo(result.code,res.userInfo);
},
});
},
fail: (err) => {
// console.log('');
this.yesAuthBtn = false;
}
});
} else {
this.$toolAll.tools.showToast('请勿重复点击');
}
},
//
updateUserInfo(code,userInfo) {
uni.showToast({title: '授权中...',icon:'loading',})
var params = {
code:code,
nickname: userInfo.nickName,//
headimgurl: userInfo.avatarUrl,//
language:userInfo.language,//
is_active:1,
}
this.$requst.post('user/login',params).then(res => {
if(res.code==0){
this.$toolAll.tools.showToast('授权成功...','success')
uni.setStorageSync('params',params);
uni.setStorageSync('userId',res.data.account_id); // id
uni.setStorageSync('token',res.data.token); // token
uni.setStorageSync('openid',res.data.openid)//openid
uni.setStorageSync('expire',res.data.expire); //
uni.setStorageSync('invite_code',res.data.invite_code); //
uni.setStorageSync('is_active',res.data.is_active);
uni.setStorageSync('phone_active',res.data.phone_active); //
this.isAnimation++;
if(res.data.phone_active==1){
//
this.showAuth = false;
uni.setStorageSync('outside',6);//
uni.reLaunch({ //
url:uni.getStorageSync('urlparams')
})
} else {
//
this.showMobile = true;
}
}
})
},
getphonenumber(e){//
wx.login({
success:(res)=>{
this.$requst.post('user/login',{code:res.code}).then(result => {
if(e.detail.errMsg=="getPhoneNumber:ok"){
this.$requst.post('user/bind-phone',{openid:result.data.openid, session_key:result.data.session_key, iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('手机号绑定成功','success');
this.showUserInfo = true;
this.showMobile = false;
uni.setStorageSync('phone_active',1);//
uni.setStorageSync('outside',6);//
// this.showAuth = false; //
// uni.reLaunch({ //
// url:uni.getStorageSync('urlparams')
// })
}
})
}
})
}
})
},
}
}
</script>
<style>
.auth-box {position: fixed;top: 0;right: 0;left: 0;bottom: 0;display: flex;justify-content: center;align-items: center;z-index: 1000;}
.auth-box > view {background-color: #FFFFFF;border-radius: 10rpx;padding: 30rpx;box-shadow: 0rpx 0rpx 20rpx rgba(0,0,0,.5);margin: 0 100rpx;}
.auth-top {display: flex;}
.auth-top image {width: 96rpx;height: 96rpx;flex-shrink: 0;}
.auth-top-content {margin-left: 20rpx;}
.auth-top-content view {font-size: 28rpx;margin-top: 20rpx;color: #999999;}
.auth-top-content view:nth-child(1) {font-size: 30rpx;font-weight: bold;margin-top: 0;}
.auth-center {font-size: 28rpx;margin: 30rpx 0;border-bottom: 1rpx solid #F5F5F5;border-top: 1rpx solid #F5F5F5;padding: 20rpx 0;}
.auth-bottom {display: flex;justify-content: center;align-items: center;font-size: 24rpx;}
.btn {padding: 20rpx 60rpx;border-radius: 4rpx;}
.btn-no {color: #07ad60;background-color: #FFFFFF;border: 1rpx solid #CCCCCC;}
.btn-yes {color: #FFFFFF;background-color: #07ad60;border: 1rpx solid #07ad60;position: relative;margin-left: 20rpx;}
.auth-btn {position: absolute;top: 0;left: 0;right: 0;bottom: 0;opacity: 0;}
.isNyin{box-shadow: 0rpx 3rpx 6rpx rgba(0,0,0,.5);}
.isOyin{box-shadow: 0rpx 3rpx 6rpx rgba(0,0,0,1);}
.card-box-userinfo {transform: rotate(360deg) scale(0);transition: all 1s ease-in-out;}
</style>

37
components/backTop.vue Normal file
View File

@ -0,0 +1,37 @@
<template>
<view>
<view v-if="showTop" class="backTop-box">
<image class="animated pulse infinite" @tap="backTop" src="/static/public/backTop.png"></image>
</view>
</view>
</template>
<script>
export default {
name:"backTop",
props:{
showTop:{
type:Boolean,
default:false
}
},
data() {
return {
};
},
onPageScroll(e) {
// console.log(e);
},
methods:{
backTop(){
this.$emit('backTop')
}
}
}
</script>
<style scoped>
.backTop-box{position: fixed;right: 20rpx;bottom: 160rpx;}
.backTop-box>image{width: 60rpx;height: 50rpx;}
</style>

53
components/bottom-tab.vue Normal file
View File

@ -0,0 +1,53 @@
<template>
<view class="posixzy disjbac bacf pad-zy32 btnBKS">
<view class="posir">
<image @tap="backHome" class="posia backH" src="/static/public/back-home-02.png" mode="aspectFill"></image>
</view>
<view class="disac fon26 colf">
<view @tap="lianK" class="disac posir lianShare" style="background-color: #3875F6; border-top-left-radius: 51rpx;border-bottom-left-radius: 51rpx;">
<image src="/static/public/bottom-customer.png" class="mar-zy20" style="width: 47rpx;height: 47rpx;" mode="aspectFill"></image>
<view>联系客服</view>
<button class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
</view>
<view class="disac posir lianShare" style="background-color: #38CE51;border-top-right-radius: 51rpx;border-bottom-right-radius: 51rpx;">
<image src="/static/public/bottom-shear.png" style="width: 47rpx;height: 47rpx;margin-left: 15rpx;margin-right: 8rpx;" mode="aspectFill">
</image>
<view>分享给好友</view>
<button class="posia" open-type="share" style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button>
</view>
</view>
</view>
</template>
<script>
export default {
name:"bottom-tab",
data() {
return {
haveImg: true,
};
},
methods:{
backHome() {
uni.reLaunch({
url: '/pages/tabbar/pagehome/pagehome'
})
},
lianK() { //
this.$requst.post('user/rand-bind-service').then(res => {})
this.$toolAll.tools.closeTimer() //
this.$requst.post('user/record', {
type: 'other',
action: 'ask',
id: 0
}).then(res => {}, error => {})
// tools.js
this.$toolAll.tools.plantPoint(5);
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,114 @@
<template>
<view>
<scroll-view scroll-x v-if="isaaaa==0">
<view class="" :class="isCenter?'disac':'disjb'">
<view @tap="choosecate(index)" v-if="item.title!='仿'"
:style="{
background : newCurrent==index ? activeb:newbmo,
fontSize:newfmo+'px',
borderRadius:newRadius+'px',
minWidth:isMinW ? newMinWidth+'px':'',
color : newCurrent==index ? activec:newcmo}"
class="flexs cateitem" :class="(!isCenter && newcateList.length<=3)?'maright0':''"
v-for="(item,index) in newcateList" :key="index">{{item.title}}</view>
</view>
</scroll-view>
<scroll-view scroll-x v-else>
<view class="disac">
<view @tap="choosecate(index)" v-if="item.title!='仿'"
:style="{
background : newCurrent==index ? activeb:newbmo,
fontSize:newfmo+'px',
borderRadius:newRadius+'px',
minWidth:isMinW ? newMinWidth+'px':'',
color : newCurrent==index ? activec:newcmo}"
class="flexs cateitem"
v-for="(item,index) in newcateList" :key="index">{{item.title}}</view>
</view>
</scroll-view>
</view>
</template>
<script>
export default {
name:"cate-pu",
props:{
isaaaa:{
type:Number,
default:0
},
isCenter:{
type:Boolean,
default:true
},
activeb:{//
type:String,
default:'#3875F6'
},
activec:{//
type:String,
default:'#FFFFFF'
},
newcateList:{//
type:Array,
default:function(){
return [
{title:'热门问题'},
{title:'病种'},
{title:'案例日记'},
{title:'效果模拟'},
{title:'效果模拟'},
]
}
},
newbmo:{//
type:String,
default:'#FFFFFF'
},
newcmo:{//
type:String,
default:'#333333'
},
newfmo:{//
type:String,
default:'15'
},
newRadius:{//
type:String,
default:'10'
},
isMinW:{//使
type:Boolean,
default:false
},
newMinWidth:{//
type:String,
default:'52'//49
},
newCurrent:{//
type:Number,
default:0
}
},
data() {
return {
current:0,
};
},
methods:{
choosecate(index){//
// console.log('',index);
this.$emit('choosecateEv',index)
}
}
}
</script>
<style scoped>
.catetwomo{background-color: #FFFFFF;color: #4D4D4D;}
.disac{display: flex;align-items: center;}
.flexs{flex-shrink: 0;}
.cateitem{padding: 16rpx 20rpx;text-align: center;margin-right: 20rpx;}
.maright0{margin-right: 0!important;}
</style>

View File

@ -0,0 +1,65 @@
<template>
<view v-if="list.lenght!=0">
<view v-for="(item,index) in list" :key="index">
<!-- 一级title -->
<view class="disjbac mar-x30 mar-s10">
<view class="fon34 bold col3">{{item.title}}</view>
<image class="mar-y50" @tap="delSearch" v-if="item.src!=''" :src="item.src" style="width: 30rpx;height: 30rpx;" mode="heightFix"></image>
</view>
<view class="fon24 col6 disac fw">
<!-- 二级title -->
<view @tap="choosetwo(index,indexo)"
v-for="(itemo,indexo) in item.list" :key="indexo"
class="radius10 mar-y20 flexs mar-x20 cate-tu-item">{{itemo.content}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
name:"cate-tu",
props:{
list:{
type:Array,
default:function(){
return []
}
},
isDetail:{
type:Boolean,
default:false
}
},
data() {
return {
};
},
methods:{
choosetwo(e1,e2){
// console.log('',e1);
// console.log('',e2);
// console.log(this.list[e1].list[e2].content);
if(this.isDetail){
uni.navigateTo({
url:`/pagesB/problemDetail/problemDetail?id=${this.list[e1].list[e2].id}&category_id=${this.list[e1].list[e2].category_id}`
})
} else {
uni.navigateTo({
url:`/pagesB/searchPage/searchPage?keyWorld=${this.list[e1].list[e2].content}`
})
}
},
delSearch(){
// this.list = []
this.$emit('delev')
}
}
}
</script>
<style>
</style>

107
components/city/city.css Normal file
View File

@ -0,0 +1,107 @@
.lotus-address-picker {
font-size: 26rpx;
padding-top: 30rpx;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 1;
-webkit-box-orient: vertical;
line-height: normal;
padding-right: 30rpx;
box-sizing: border-box;
}
.lotus-address-picker-box {
/*display: -webkit-box;
display: -webkit-flex;*/
display: flex;
align-items: center;
justify-content: center;
justify-content: flex-start;
padding-top: 10rpx;
padding-bottom: 10rpx;
}
.lotus-address-picker-box-item {
height: 600upx;
overflow-y: auto;
width: 33.333%;
padding-left: 20rpx;
padding-right: 20rpx;
box-sizing: border-box;
}
.lotus-address-picker2 {
color: #e93b3d;
position: relative;
}
.lotus-address-picker2:after {
content: '';
position: absolute;
right: 0;
top: 65%;
transform: translateY(-35%) rotate(-45deg);
width: 20rpx;
height: 10rpx;
border-left-width: 4rpx;
border-bottom-width: 4rpx;
border-left-style: solid;
border-bottom-style: solid;
border-left-color: #e93b3d;
border-bottom-color: #e93b3d;
}
.lotus-address-mask {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 999;
background: rgba(0, 0, 0, 0.5);
}
.lotus-address-box {
background: #fff;
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: auto;
}
.lotus-address-action {
font-size: 30rpx;
/*display: -webkit-box;
display: -webkit-flex;*/
display: flex;
align-items: center;
justify-content: center;
justify-content: space-between;
padding: 25rpx 30rpx;
position: relative;
}
.lotus-address-action:after {
content: " ";
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1px solid #eee;
color: #eee;
transform-origin: 0 0;
transform: scaleY(0.5);
}
.lotus-address-action:before {
content: " ";
position: absolute;
left: 0;
bottom: 0;
right: 0;
height: 1px;
border-bottom: 1px solid #eee;
color: #eee;
transform-origin: 0 100%;
transform: scaleY(0.5);
}
.lotus-address-action-cancel {
color: #969696;
}
.lotus-address-action-affirm {
color: #e93b3d;
}

16498
components/city/city.js Normal file

File diff suppressed because it is too large Load Diff

233
components/city/city.vue Normal file
View File

@ -0,0 +1,233 @@
<template>
<!--地址picker-->
<view :status="checkStatus" v-if="lotusAddressData.visible" class="lotus-address-mask">
<view :class="lotusAddressData.visible?'lotus-address-box':'lotus-address-box lotus-address-box-out'">
<view class="lotus-address-action">
<text @tap="cancelPicker" class="lotus-address-action-cancel">取消</text>
<text @tap="chosedVal" class="lotus-address-action-affirm">确认</text>
</view>
<view class="lotus-address-picker-box">
<!---->
<scroll-view scroll-y :scroll-into-view="'pid'+pChoseIndex" class="lotus-address-picker-box-item">
<view @tap="clickPicker(0,pIndex,pItem);" :id="'pid'+pIndex" :class="pIndex === pChoseIndex?'lotus-address-picker lotus-address-picker2':'lotus-address-picker'" v-for="(pItem,pIndex) in province" :key="pIndex">{{pItem}}</view>
</scroll-view>
<!---->
<scroll-view scroll-y :scroll-into-view="'cid'+cChoseIndex" class="lotus-address-picker-box-item">
<view @tap="clickPicker(1,cIndex,cItem);" :id="'cid'+cIndex" :class="cIndex === cChoseIndex?'lotus-address-picker lotus-address-picker2':'lotus-address-picker'" v-for="(cItem,cIndex) in city" :key="cIndex">{{cItem}}</view>
</scroll-view>
<!---->
<scroll-view scroll-y :scroll-into-view="'tid'+tChoseIndex" class="lotus-address-picker-box-item">
<view @tap="clickPicker(2,tIndex,tItem);" :id="'tid'+tIndex" :class="tIndex === tChoseIndex?'lotus-address-picker lotus-address-picker2':'lotus-address-picker'" v-for="(tItem,tIndex) in town" :key="tIndex">{{tItem}}</view>
</scroll-view>
<!--区END-->
</view>
</view>
</view>
<!--地址picker END-->
</template>
<script>
import {lotusAddressJson} from "./city.js";
export default {
props:['lotusAddressData'],
data() {
return {
visible: false,
province:[],
city:[],
town:[],
provinceName:'',
cityName:'',
townName:'',
type:0,//01
pChoseIndex:-1,
cChoseIndex:-1,
tChoseIndex:-1
};
},
methods:{
//
cancelPicker(){
const provinceCode = this.getTarId(this.provinceName);
const cityCode = this.getTarId(this.cityName);
const townCode = this.getTarId(this.townName);
this.visible = false;
this.$emit("choseVal",{
province:this.provinceName,
provinceCode,
city:this.cityName,
cityCode,
town:this.townName,
townCode,
isChose:0,
visible:false
});
},
//
chosedVal() {
this.type = 1;
const provinceCode = this.getTarId(this.provinceName);
const cityCode = this.getTarId(this.cityName);
const townCode = this.getTarId(this.townName);
this.visible = false;
let isChose = 0;
// isChose = 1
if((this.provinceName&&this.cityName)||(this.provinceName&&this.cityName&&this.townName)){
isChose = 1;
}
this.$emit("choseVal",{
province:this.provinceName,
provinceCode,
city:this.cityName,
cityCode,
town:this.townName,
townCode,
isChose,
visible:false
});
},
//value
getTarId(name,type){
let id = 0;
lotusAddressJson.map((item,index)=>{
if(item.name === name){
id = item.value;
}
});
return id;
},
//
getCityArr(parentId){
let city = [];
lotusAddressJson.map((item,index)=>{
if(item.parent === parentId){
city.push(item.name);
}
});
return city;
},
//
getTownArr(parentId){
let town = [];
lotusAddressJson.map((item,index)=>{
if(index>34&&item.parent === parentId){
town.push(item.name);
}
});
return town;
},
//
initFn(){
if(!this.province.length){
lotusAddressJson.map((item,index)=>{
if(index<=34){
this.province.push(item.name);
}
});
}
//
const p = this._props.lotusAddressData.provinceName;
const c = this._props.lotusAddressData.cityName;
const t = this._props.lotusAddressData.townName;
//
if(p){
this.pChoseIndex = this.getTarIndex(this.province,p);
}
//
if(p&&c){
const pid = this.getTarId(p);
this.city = this.getCityArr(pid);
this.cChoseIndex = this.getTarIndex(this.city,c);
}
//
if(p&&c&&t){
const cid= this.getTarId(c);
this.town = this.getTownArr(cid);
this.tChoseIndex = this.getTarIndex(this.town,t);
}
//
if(!p&&!c&&!t){
this.pChoseIndex = -1;
this.cChoseIndex = -1;
this.tChoseIndex = -1;
this.city = [];
this.town = [];
}
},
//
getChosedData(){
const pid = this.getTarId(this.provinceName,'province');
this.city = this.getCityArr(pid);
const cid= this.getTarId(this.cityName,'city');
this.town = this.getTownArr(cid);
//index
if(this.provinceName){
this.pChoseIndex = this.getTarIndex(this.province,this.provinceName);
}
if(this.cityName){
this.cChoseIndex = this.getTarIndex(this.city,this.cityName);
}
if(this.townName){
this.tChoseIndex = this.getTarIndex(this.town,this.townName);
}
},
//
clickPicker(type,index,name){
//
if(type === 0){
this.pChoseIndex = index;
this.provinceName = name;
this.cChoseIndex = -1;
this.tChoseIndex = -1;
this.cityName = '';
this.townName = '';
}
//
if(type ===1){
this.cChoseIndex = index;
this.cityName = name;
this.tChoseIndex = -1;
this.townName = '';
}
//
if(type === 2){
this.tChoseIndex = index;
this.townName = name;
}
//
this.getChosedData();
},
//index
getTarIndex(arr,tarName){
let cIndex = 0;
arr.map((item,index)=>{
if(item === tarName){
cIndex = index;
}
});
return cIndex;
}
},
computed:{
checkStatus(){
let t = null;
const _this = this;
if(!_this.visible){
_this.visible = _this._props.lotusAddressData.visible;
//
_this.provinceName = _this._props.lotusAddressData.provinceName;
_this.cityName = _this._props.lotusAddressData.cityName;
_this.townName = _this._props.lotusAddressData.townName;
//
_this.initFn();
t = _this.visible;
}
return t;
}
}
}
</script>
<style lang="less">
@import "./city.css";
</style>

169
components/foot-tab.vue Normal file
View File

@ -0,0 +1,169 @@
<template>
<view>
<!-- 方案一 -->
<!-- <view class="foot-box">
<view @tap="choosefoot(index)" v-for="(item,index) in tabArr" :key="index" style="display: flex;justify-content: center;flex-direction: column;align-items: center;">
<image class="moImg" v-if="newcurrent==index" :src="item.selectedIconPath"></image>
<image class="moImg" v-else :src="item.iconPath"></image>
<view :class="newcurrent==index?'footactive':'footmo'" style="margin-top: 8rpx;">{{item.text}}</view>
</view>
</view> -->
<!-- 方案二 -->
<view class="foot-boxtwo">
<!-- 图片列表 -->
<view class="item-box">
<view v-for="(itemi,index) in imgList" :key="index" @tap="choosefoot(index)" :class="index==2 ? 'centerBox':''">
<view class="posir" :class="index==2 ? 'centerBox-item':''">
<image :class="index==2 ? 'centerImg':'moImg'" v-if="newcurrent==index" :src="itemi.selectedIconPath"></image>
<image :class="index==2 ? 'centerImg':'moImg'" v-else :src="itemi.iconPath"></image>
<button v-if="index==2 && isKef" class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact"></button>
</view>
</view>
</view>
<!-- 标题列表 -->
<view class="item-box">
<view @tap="choosefoot(index)" :class="newcurrent==index ? 'footactive':'footmo'"
v-for="(itemt,index) in titleList" :key="index">{{itemt}}</view>
</view>
</view>
<!-- 弹框 -->
<pu-po :isShowT="isShowT" :comfrimVal="'好的'" :contentVal="'暂未开放此功能,请耐心等候'"
:isCenter="true" @comfirmev="comfirmev"></pu-po>
</view>
</template>
<script>
export default {
name:'footTab',
props:{
newcurrent:{
type:Number,
default:0
},
titleList:{
type:Array,
default:function(){
return uni.getStorageSync('footTitle')
// return ['','','','','']
}
},
imgList:{
type:Array,
default:function(){
return uni.getStorageSync('imgList')
// return [
// {
// iconPath: '/static/tabbar/homem.png',//icon
// selectedIconPath: '/static/tabbar/homeAc.png',//icon
// },
// {
// iconPath: '/static/tabbar/catem.png',//icon
// selectedIconPath: '/static/tabbar/cates.png',//icon
// },
// {
// iconPath: '/static/tabbar/customerm.png',//icon
// selectedIconPath: '/static/tabbar/customerm.png',//icon
// },
// {
// iconPath: '/static/tabbar/shopm.png',//icon
// selectedIconPath: '/static/tabbar/shopa.png',//icon
// },
// {
// iconPath: '/static/tabbar/mym.png',//icon
// selectedIconPath: '/static/tabbar/mya.png',//icon
// }
// ]
}
}
},
data() {
return {
vision:false,
isShowT:false,
isKef:true,
};
},
mounted() {
if(uni.getStorageSync('phone_active')==0) this.isKef = false
},
methods:{
cancleEv(e){
if(e==0) this.vision = false
},
choosefoot(index){
let existMobile = uni.getStorageSync('phone_active');
// this.current = index
switch (index){
case 0:
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
break;
case 1:
existMobile!='' ? uni.reLaunch({url:'/pages/tabbar/cate/cate?index=0'}) : this.goLogin();
break;
case 2:
if(existMobile!=''){
// wx.openCustomerServiceChat({
// extInfo: {url: `https://work.weixin.qq.com/kfid/kfcb3bba5b57d9a42ba?enc_scene=ENC616HXDjLYNcmsR49PBE75UERg8Ncv3dygpYjfnh3XVvA&scene_param=${uni.getStorageSync('openid')}`},
// corpId: 'ww1f86f258d4ff5817',
// success(res) {}
// })
this.$requst.post('user/rand-bind-service').then(res=>{})
this.$toolAll.tools.closeTimer()//
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
// tools.js
this.$toolAll.tools.plantPoint(5);
} else this.goLogin()
break;
case 3:
existMobile!='' ? uni.reLaunch({url:'/pages/tabbar/shop/shop'}) : this.goLogin();
break;
case 4:
existMobile!='' ? uni.reLaunch({url:'/pages/tabbar/my/staffDuan'}) : this.goLogin();
break;
}
},
//
goLogin(){
uni.reLaunch({
url:'/pages/login/login'
})
},
comfirmev(){
this.isShowT = false
}
}
}
</script>
<style>
/* 方案一 */
/* .foot-box{
height: 140rpx;
font-size: 24rpx;
border-top: 1rpx solid #FFFFFF;
background-color: #FFFFFF;
position: fixed;bottom: 0;left: 0;right: 0;
display: flex;justify-content: space-around;align-items: center;
}*/
/* 方案二 */
.foot-boxtwo{
height: 140rpx;
font-size: 24rpx;
border-top: 1rpx solid #FFFFFF;
background-color: #FFFFFF;
position: fixed;bottom: 0;left: 0;right: 0;z-index: 10;
display: flex;flex-direction: column;justify-content: center;
}
.item-box{display: flex;justify-content: space-around;align-items: center;}
.item-box>view{width: 25%;text-align: center;}
.centerBox{display: flex;justify-content: center;align-items: center;}
/* .centerBox-item{width: 124rpx;height: 124rpx;background-color: rgba(244, 244, 244, 1);margin-top: -100rpx;border-radius: 100%;display: flex;justify-content: center;align-items: center;} */
.centerBox-item{width: 124rpx;height: 124rpx;margin-top: -100rpx;border-radius: 100%;display: flex;justify-content: center;align-items: center;}
.centerImg{width: 112rpx;height: 112rpx;}
/* 公共 */
.moImg{width: 64rpx;height: 64rpx;}
.footactive{color: #000000;}
.footmo{color: #999999;}
</style>

View File

@ -0,0 +1,49 @@
<template>
<view class="disjb fw">
<view @tap="chooseDoctor(index)" class="radius10 dis fc bacf mar-x20" style="width: 48.6%;" v-for="(item,index) in list" :key="index">
<image :src="item.imgSrc" class="doctorImg radius10" mode="aspectFill" lazy-load></image>
<!-- <view class="col3 mar-s10 mar-x20 mar-z10">
<view class="fon28 bold doctoritem disac">{{item.name}}</view>
<view class="fon24 disac fw mar-s10" style="width: 166px;">
<view class="flexs">擅长</view>
<view class="flexs" v-for="(itemt,indext) in item.goodAt" :key="indext">
<text class="bold mar-y10 pcol">{{itemt.disease_name}}</text>
</view>
</view>
</view> -->
</view>
</view>
</template>
<script>
export default {
name:"list-doctor",
props:{
list:{
type:Array,
default:function(){
return []
}
}
},
data() {
return {
};
},
methods:{
chooseDoctor(index){//
console.log(this.list[index].id);
if(this.list[index].show_detail==1){
uni.navigateTo({
url:'/pagesB/doctorDetail/doctorDetail?doctor_id='+this.list[index].id
})
} else this.$toolAll.tools.showToast('禁止查看该医生信息')
},
}
}
</script>
<style>
</style>

185
components/list-pu.vue Normal file
View File

@ -0,0 +1,185 @@
<template>
<view>
<view class="disjb fw" v-if="list.length!=0">
<!-- 左侧列表 -->
<view class="list-box">
<view @tap="goDetail(index)" v-if="index%2==0" :class="radiu?'radius15 mar-x10':'radius30 mar-x30'" class="posir colf zou" v-for="(item,index) in list" :key="index">
<!-- 背景图 -->
<image lazy-load :class="radiu?'radius15':'radius30'" class=" width100 list-min" :src="item.main_img" mode="widthFix"></image>
<view class="posia fon24 colf" style="right: 10rpx;bottom: 160rpx;z-index: 1;">
<view @tap.stop="praiseEv(index)" class="disjcac fc">
<image class="img-box" lazy-load :style="{width: radiu ?'40rpx':'60rpx',height: radiu ?'40rpx':'60rpx'}" :src="['/static/public/list-nlike.png','/static/public/detail-like.png'][item.is_liked]" mode="aspectFill"></image>
<view>{{item.likes>100 ? '99+':item.likes}}</view>
</view>
<view @tap.stop="chooseLike(index)" class="disjcac fc mar-s10">
<image class="img-box" lazy-load :style="{width: radiu ?'40rpx':'60rpx',height: radiu ?'40rpx':'60rpx'}" :src="['/static/public/cnllection-no.png','/static/public/yconllection.png'][item.is_collected]" mode="aspectFill"></image>
<view>{{item.collects>100 ? '99+':item.collects}}</view>
</view>
</view>
<!-- <view class="posia list-like-box" @tap.stop="chooseLike(index)"> -->
<!-- 不喜欢 -->
<!-- <image v-if="item.is_collected!=1" src="/static/public/no-like.png" mode="aspectFill"></image> -->
<!-- 喜欢 -->
<!-- <image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image>
</view> -->
<view v-if="item.main_img!=''" :class="radiu?'list-cont-box15':'list-cont-box'" class="posia fon20">
<!-- 视频标题 -->
<view class="fon30 bold mar-x10 disac" :style="{fontSize:nFon+'px'}">
<view class="clips1">{{item.title}}</view>
<!-- <text v-if="item.isVideo && isVedio" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs"></text> -->
</view>
<!-- 视频描述 -->
<view class="mar-x10 clips1 opc">{{item.content}}</view>
<view class="disjbac">
<view class="disac">
<!-- 发布者头像 -->
<image lazy-load class="list-headimg" :src="item.head_img" mode="aspectFill"></image>
<!-- 发布者昵称 -->
<view class="clips1 opc">{{item.name}}</view>
</view>
<text v-if="item.isVideo && isVedio" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs"></text>
</view>
</view>
<!-- <image v-if="item.isVideo && isVedio" :style="{width:nWidth+'rpx',height:nHeight+'rpx'}" class="posia" style="top: 50%;left: 50%;transform: translate(-50%,-50%);" src="/static/public/video.png" mode=""></image> -->
</view>
</view>
<!-- 右侧列表 -->
<view class="list-box">
<view @tap="goDetail(index)" v-if="index%2!=0" :class="radiu?'radius15 mar-x10':'radius30 mar-x30'" class="posir colf zou" v-for="(item,index) in list" :key="index">
<!-- 背景图 -->
<image lazy-load :class="radiu?'radius15':'radius30'" class="width100 list-min" :src="item.main_img" mode="widthFix"></image>
<view class="posia fon24 colf" style="right: 10rpx;bottom: 160rpx;z-index: 1;">
<view @tap.stop="praiseEv(index)" class="disjcac fc">
<image class="img-box" lazy-load :style="{width: radiu ?'40rpx':'60rpx',height: radiu ?'40rpx':'60rpx'}" :src="['/static/public/list-nlike.png','/static/public/detail-like.png'][item.is_liked]" mode="aspectFill"></image>
<view>{{item.likes>100 ? '99+':item.likes}}</view>
</view>
<view @tap.stop="chooseLike(index)" class="disjcac fc mar-s10">
<image class="img-box" lazy-load :style="{width: radiu ?'40rpx':'60rpx',height: radiu ?'40rpx':'60rpx'}" :src="['/static/public/cnllection-no.png','/static/public/yconllection.png'][item.is_collected]" mode="aspectFill"></image>
<view>{{item.collects>100 ? '99+':item.collects}}</view>
</view>
</view>
<!-- <view class="posia list-like-box" @tap.stop="chooseLike(index)"> -->
<!-- 不喜欢 -->
<!-- <image v-if="item.is_collected!=1" src="/static/public/no-like.png" mode="aspectFill"></image> -->
<!-- 喜欢 -->
<!-- <image v-else :class="item.is_collected==1?'bounceIn':'bounceOut'" class="animated" src="/static/public/like.png" mode="aspectFill"></image>
</view> -->
<view v-if="item.main_img!=''" :class="radiu?'list-cont-box15':'list-cont-box'" class="posia fon20 ">
<!-- 视频标题 -->
<view class="fon30 bold mar-x10 disac" :style="{fontSize:nFon+'px'}">
<view class="clips1">{{item.title}}</view>
<!-- <text v-if="item.isVideo && isVedio" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs"></text> -->
</view>
<!-- 视频描述 -->
<view class="mar-x10 clips1 opc">{{item.content}}</view>
<view class="disjbac">
<view class="disac">
<!-- 发布者头像 -->
<image lazy-load class="list-headimg" :src="item.head_img" mode="aspectFill"></image>
<!-- 发布者昵称 -->
<view class="clips1 opc">{{item.name}}</view>
</view>
<text v-if="item.isVideo && isVedio" :style="{fontSize:(nFon-2)+'px',marginLeft:nmarz+'px'}" style="border-radius: 5rpx;padding: 0 6rpx;text-align: center;" class="pbackc flexs"></text>
</view>
</view>
<!-- <image v-if="item.isVideo && isVedio" :style="{width:nWidth+'rpx',height:nHeight+'rpx'}" class="posia" style="top: 50%;left: 50%;transform: translate(-50%,-50%);" src="/static/public/video.png" mode=""></image> -->
</view>
</view>
</view>
<view v-else class="" style="display: flex;flex-direction: column;align-items: center;">
<image src="/static/public/nothing.png" style="width: 474rpx;height: 273rpx;" mode="aspectFill"></image>
<!-- <view class="fon24 col3" style="margin-bottom: 60rpx;">暂无内容</view> -->
</view>
<!-- 弹框 -->
<pu-po :isShowT="isShowT" :contentVal="pu_content" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
</view>
</template>
<script>
export default {
name:"list-pu",
props:{
list:{//
type:Array,
default:function(){
return []
}
},
nWidth:{
type:String,
default:'120'
},
nHeight:{
type:String,
default:'120'
},
nFon:{
type:String,
default:'15'
},
nmarz:{
type:String,
default:'10'
},
radiu:{
type:Boolean,
default:false
}
},
data() {
return {
isShowT:false,
pu_content:'是否需要取消收藏?',
current:'-1',
isVedio:false
};
},
mounted() {
this.$requst.get('index/base-config').then(res=>{
res.data.v==0 ? this.isVedio = false : this.isVedio = true;
})
},
methods:{
goDetail(index){//
if(this.$toolAll.tools.judgeAuth()){
uni.navigateTo({
url:'/pagesB/problemDetail/problemDetail?id='+this.list[index].id+'&category_id='+this.list[index].category_id
})
}
},
chooseLike(index){//
// console.log('',index);
if(this.$toolAll.tools.judgeAuth()){
this.$emit('chooseLike',index)
this.current = index
if(this.list[index].is_collected==1) {
this.isShowT = true
} else {
// tools.js
this.$toolAll.tools.plantPoint(3,this.list[index].id);
}
}
},
//
praiseEv(index){
if(this.$toolAll.tools.judgeAuth()){
this.$emit('praise',index)
this.current = index
}
},
comfirmev(){
// console.log('');
this.$emit('comfirmev',this.current)
this.isShowT = false
},
cancleev(){
// console.log('');
this.isShowT = false
}
}
}
</script>
<style>
.img-box {border-radius: 100%;}
</style>

View File

@ -0,0 +1,61 @@
<template>
<text :style="{ color: color, 'font-size': size + 'rpx' }" :class="{isTheme:isTheme}" class="lw-icons"
@click="_onClick">{{icons[icon]}}</text>
</template>
<script>
import icons from './icons.js';
// #ifdef APP-NVUE
var domModule = weex.requireModule('dom');
domModule.addRule('fontFace', {
'fontFamily': 'iconfont',
'src': 'url(\'https://at.alicdn.com/t/font_2294175_vq7ymlkpbtm.ttf\')',
});
// #endif
export default {
name: 'UniIcons',
props: {
icon: {
type: String,
default: ''
},
color: {
type: String,
default: '#333333'
},
size: {
type: [Number, String],
default: 50
},
isTheme: {
type: Boolean,
default: false
}
},
data() {
return {
icons: icons
}
},
methods: {
_onClick() {
this.$emit('click')
}
}
}
</script>
<style lang="scss" scoped>
/* #ifndef APP-NVUE */
@font-face {
font-family: iconfont;
src: url('https://at.alicdn.com/t/font_2294175_vq7ymlkpbtm.ttf')
}
/* #endif */
.lw-icons {
font-family: iconfont;
text-decoration: none;
text-align: center;
}
</style>

View File

@ -0,0 +1,6 @@
export default {
'aixin':'\ue8ab',
'rules':'\ue909',
'sound':'\ue8ea',
'arrowright':'\uee02'
}

View File

@ -0,0 +1,373 @@
<template>
<view>
<view class="contentBox" v-if="list.length" @click="toEmit()"
:style="'color:' + color + ';background-color:' + backgroundColor + ';height:' + height+'rpx;'">
<view v-if="showIcon" class="supBox">
<lwIcon :size="32" :color="iconColor" icon="sound"></lwIcon>
</view>
<view v-if="list.length > 1" class="content">
<view v-for="(item, index) in list" :key="index" @tap.stop="dangGao(index)">
<view class="loopItemBase" :class="index==0&&firstIn?'fistInClass':''"
:animation="realAnimation(index)" v-if="aindexArr.includes(index)"
:style="'line-height:'+height+'rpx;'">
{{ item }}
</view>
</view>
</view>
<view v-if="list.length == 1" class="content">
<view :style="'line-height:'+height+'rpx;'" @tap.stop="dangGao(0)" class="loopItemBaseShow">{{ list[0] }}</view>
</view>
<view v-if="showMore" class="offBox">
<lwIcon :size="32" :color="moreColor" icon="arrowright"></lwIcon>
</view>
</view>
</view>
</template>
<script>
/*
lw-notice公告上下轮询组件组件内依赖了自有的字体图标组件可自行替换为uni或自身项目的图标组件
color:字体颜色
backgroundColor:背景色
list:要循环的列表数据
height:组件高度
showScale:是否有缩放动画
runTime:间隔切换时间
showIcon:是否显示头部小喇叭
iconColor:小喇叭的颜色
showMore:是否显示尾部更多
moreColor:显示更多的颜色
*/
import lwIcon from './iconFont.vue'
export default {
components: {
lwIcon
},
props: {
color: {
type: String,
default: '#666666'
},
backgroundColor: {
type: String,
default: '#f5f5f5'
},
list: {
type: Array,
default: function(){
return []
}
},
height: {
type: Number,
default: 80
},
showScale: {
type: Boolean,
default: false
},
runTime: {
type: Number,
default: 4000
},
showIcon: {
type: Boolean,
default: false
},
showMore: {
type: Boolean,
default: false
},
iconColor: {
type: String,
default: '#aaaaaa'
},
moreColor: {
type: String,
default: '#aaaaaa'
}
},
data() {
return {
//
firstIn: true,
//
aindexArr: [],
//
animation: null,
//
animationData: null,
//
animationDataTwo: null,
//
indexLinkAnimationObj: {},
setTimerOne: null,
setTimerTwo: null,
setTimerThree: null,
setTimerFour: null,
setTimerFive: null
};
},
beforeDestroy() {
this.resetPage()
},
computed: {
//
realAnimation() {
return function(value) {
if (this.indexLinkAnimationObj[value]) {
return this[this.indexLinkAnimationObj[value]]
} else {
return {}
}
}
}
},
methods: {
// 3000
// 1.a 1 1 0ms
// 2.b 2 2 200ms
// 3.a 1 1 300ms
// 4.c 1 1 400ms
// 5.b 2 2 500ms
// 6.a 2 2 600ms
// 7.c 1 1 700ms
// 8.b 1 1 800ms
// 9.a 2 2 900ms
// 10.c 2 2 1000ms
initPage() {
this.resetPage();
if (this.list && this.list.length) {
if (this.list.length > 1) {
this.aindexArr.push(0);
this.animation = uni.createAnimation({
timingFunction: 'linear',
})
// #ifdef H5
this.animationDataH5 = this.animation.translateY(-100).step({
duration: 10000
}).export()
// #endif
this.runAnimation(0, true);
}
}
},
//
resetPage() {
//
clearTimeout(this.setTimerOne);
clearTimeout(this.setTimerTwo);
clearTimeout(this.setTimerThree);
clearTimeout(this.setTimerFour);
clearTimeout(this.setTimerFive);
//
this.aindexArr = [];
this.animation = null;
this.animationData = null;
this.animationDataTwo = null;
this.indexLinkAnimationObj = {};
},
// ()
runAnimation(value, firstIn) {
let that = this;
if (!firstIn) {
that.aindexArr.push(value);
}
//
let lockText = that.createAni(firstIn);
// 50(dom)
that.setTimerOne = setTimeout(() => {
//
that.indexLinkAnimationObj[value] = lockText;
// console.log('')
// console.log(that.indexLinkAnimationObj)
//
let unitRunTime = (that.runTime - 50) / 6;
let waitTime = firstIn ? unitRunTime * 4 : unitRunTime * 5;
let waitTimeTwo = firstIn ? (that.runTime - unitRunTime) : that.runTime;
// #ifdef H5
waitTimeTwo = firstIn ? (that.runTime - (1.5 * unitRunTime)) : that.runTime;
//H5
if (firstIn) {
that.aindexArr.splice(0, 1);
that.aindexArr.push(0);
}
// #endif
//
that.setTimerTwo = setTimeout(() => {
let Index = value == that.list.length - 1 ? 0 : value + 1;
that.runAnimation(Index)
}, waitTime)
//
that.setTimerThree = setTimeout(() => {
let index = that.aindexArr.indexOf(value);
that.aindexArr.splice(index, 1)
that.firstIn = false;
delete that.indexLinkAnimationObj[value]
}, waitTimeTwo)
}, 50)
},
//
createAni(firstIn) {
let that = this;
let unitRunTime = (that.runTime - 50) / 6;
let delayTime = unitRunTime * 4;
let durationTime = unitRunTime;
let dispairTime = unitRunTime;
// #ifdef H5
delayTime = unitRunTime * 3.5;
dispairTime = unitRunTime * 1.5;
// #endif
let showTransformHeight = -uni.upx2px(that.height);
let hideTransformHeight = showTransformHeight * 2;
//
if (that.showScale) {
if (firstIn) {
// that.animation.translateY(1).scale(1,1).step({ duration: 5 });
that.animation.translateY(showTransformHeight).scale(0.5, 0.5).step({
delay: delayTime,
duration: dispairTime
});
} else {
that.animation.translateY(showTransformHeight).scale(1, 1).step({
duration: durationTime
});
that.animation.translateY(hideTransformHeight).scale(0.5, 0.5).step({
delay: delayTime,
duration: dispairTime
});
}
} else {
if (firstIn) {
// that.animation.translateY(1).step({ duration: 5 });
that.animation.translateY(showTransformHeight).step({
delay: delayTime,
duration: dispairTime
});
} else {
that.animation.translateY(showTransformHeight).step({
duration: durationTime
});
that.animation.translateY(hideTransformHeight).step({
delay: delayTime,
duration: dispairTime
});
}
}
//
if (!that.animationData) {
that.animationData = that.animation.export()
that.setTimerFour = setTimeout(() => {
clearTimeout(that.setTimerFour)
that.animationData = false;
}, that.runTime)
return 'animationData'
} else {
that.animationDataTwo = that.animation.export()
that.setTimerFive = setTimeout(() => {
clearTimeout(that.setTimerFive)
that.animationDataTwo = false;
}, that.runTime)
return 'animationDataTwo'
}
},
//
toEmit() {
let that = this
if (that.list.length == 1) {
that.$emit('itemClick', that.list[0])
} else {
that.$emit('itemClick', that.list[that.aindexArr[0]])
}
},
dangGao(index){
let that = this
if (that.list.length != 0) {
that.$emit('dangGao', index)
}
}
},
created() {
},
mounted() {
// list
// setTimeout()
this.initPage()
},
watch: {
list(value) {
this.initPage()
}
}
};
</script>
<style lang="scss" scoped>
.contentBox {
width: 100%;
display: flex;
// padding: 0 20rpx;
align-items: center;
box-sizing: border-box;
font-size: 24rpx;
.supBox {
width: 50rpx;
display: flex;
justify-content: flex-start;
}
.offBox {
width: 50rpx;
display: flex;
justify-content: flex-end;
}
.content {
width: 100%;
flex-grow: 1;
height: 100%;
display: flex;
overflow: hidden;
position: relative;
align-items: center;
box-sizing: border-box;
justify-content: center;
.loopItemBase {
left: 0;
top: 100%;
width: 100%;
height: 100%;
overflow: hidden;
font-size: 28rpx;
text-align: left;
position: absolute;
white-space: nowrap;
align-items: center;
text-overflow: ellipsis;
&.fistInClass {
top: 0;
}
}
.loopItemBaseShow {
top: 0;
left: 0;
width: 100%;
height: 100%;
overflow: hidden;
font-size: 28rpx;
text-align: left;
position: absolute;
white-space: nowrap;
align-items: center;
text-overflow: ellipsis;
}
}
}
</style>

View File

@ -0,0 +1,36 @@
<template>
<view class="nothing">
<view class="nothing-box">
<image lazy-load :src="imgSrc" mode="aspectFill"></image>
<view class="nothing-con">{{content}}</view>
</view>
</view>
</template>
<script>
export default {
name:"nothing-page",
props:{
imgSrc:{
type:String,
default:'/static/public/nothing.png'
},
content:{
type:String,
default:'暂无内容'
}
},
data() {
return {
};
}
}
</script>
<style scoped>
.nothing{position: fixed;top: 0;right: 0;left: 0;bottom: 0;display: flex;justify-content: center;align-items: center;}
.nothing-box{display: flex;justify-content: center;flex-direction: column;align-items: center;}
.nothing-box>image{width: 474rpx;height: 273rpx;}
.nothing-con{font-size: 24rpx;font-family: PingFang SC;font-weight: 500;line-height: 33rpx;color: #333333;text-align: center;}
</style>

View File

@ -0,0 +1,62 @@
<template>
<view>
<view @tap="lianK" :style="{background:publicColor,right:nright+'rpx',bottom:nbottom+'rpx'}" :class="isSmall?'smallImg':''" class="fw posir customer-box" style="position: fixed;z-index: 2; width: 120rpx;height: 120rpx;border-radius: 100%;display: flex;justify-content: center;align-items: center;box-shadow: 0rpx 0rpx 20rpx rgba(0,0,0,.22);">
<image class="posia" src="/static/public/btnKF.png" style="width: 50rpx;height: 50rpx;top: 20rpx;" mode="" lazy-load></image>
<view class="colf fon20 posia" style="bottom: 20rpx;">在线客服</view>
<button class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
</view>
</view>
</template>
<script>
export default {
name:"public-customer",
props:{
nright:{//
type:Number,
default:30
},
nbottom:{//
type:Number,
default:260
},
isSmall:{//
type:Boolean,
default:false
},
nid:{//id
type:String,
default:'0'
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
data() {
return {};
},
methods:{
lianK(){
this.$requst.post('user/rand-bind-service').then(res=>{})
this.$toolAll.tools.closeTimer()//
this.$requst.post('user/record',{type:'other',action:'ask',id:this.nid}).then(res=>{},error=>{})
// tools.js
this.$toolAll.tools.plantPoint(5);
}
}
}
</script>
<style>
.smallImg{transform: scale(.8);margin-right: -10rpx;}
.customer-box {
animation: scale_name 1s linear alternate infinite;
}
@keyframes scale_name{
from{transform: scale(1);}
to{transform: scale(1.2);}
}
</style>

163
components/pupo.vue Normal file
View File

@ -0,0 +1,163 @@
<template>
<view v-if="isShowT" class="disjcac posAll" @tap="closeXial">
<view class="bacf radius20 width100 tank-box">
<view v-if="isXiala" class="pad-x20">
<view class="mar-s30 mar-x40 tc">请选择客服</view>
<view @tap.stop="openXia" class="disjbac radius10 pad-zy20 mar-zy20 xialak mar-x50 posir">
<view class="col3" v-if="!isTag">{{category[current].title}}</view>
<view class="col3 disac width100" v-if="isTag"><input class="width100 mar-y20" disabled v-model="tagStr"></view>
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<!-- 下拉列表 -->
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
<!-- 普通下拉 -->
<view class="pad-zy20 xial-item-box" v-if="!isTag">
<view @tap.stop="chooseXia(index)":class="current==index?'pcol':''" v-for="(item,index) in category" :key="index">{{item.title}}</view>
</view>
<!-- 标签下拉 -->
<view class="pad-zy20 xial-item-box" v-if="isTag">
<!-- <view class="disac" @tap.stop="quanEv" :class="isAll?'pcol':''">
<checkbox style="width: 60rpx;height: 60rpx;display: inherit;" color="#3875F6" :checked="isAll" />
全选
</view> -->
<view @tap.stop="chooseXiaTag(index)" class="disac" :class="item.checked?'pcol':''" v-for="(item,index) in category" :key="index">
<view v-if="" class="disac">
<checkbox style="width: 60rpx;height: 60rpx;display: inherit;" color="#3875F6" :data-id="item.id" :checked="item.checked" />
</view>
{{item.title}}
</view>
</view>
</view>
</view>
</view>
<view v-else class="tc tank-box-itemone">{{contentVal}}</view>
<view :class="isCenter?'disjcac':'disjb'" class="fon28 colf pad-x30 pad-zy30 tc">
<view @tap="cancleEv" v-if="!isCenter" class="pad-sx20 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">{{clearVal}}</view>
<view @tap="comfirEv" :style="{background:publicColor}" class="pad-sx20 radius10 tank-btn">{{comfrimVal}}</view>
</view>
</view>
</view>
</template>
<script>
export default {
name:"pupo",
props:{
isShowT:{
type:Boolean,
default:false
},
isCenter:{//
type:Boolean,
default:false
},
contentVal:{
type:String,
default:'是否清除历史搜索?'
},
clearVal:{//
type:String,
default:'取消'
},
comfrimVal:{//
type:String,
default:'确认'
},
isXiala:{
type:Boolean,
default:false
},
category:{
type:Array,
default:function(){
return ['许嵩']
}
},
isTag:{
type:Boolean,
default:false
}
},
data() {
return {
isZhuan:false,
current:0,
tagIds:[],
tagVal:[],
tagStr:'请选择',
isAll:false
};
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
methods:{
//
closeXial(){
this.isZhuan = false;
},
comfirEv(){//
this.isZhuan = false
this.current = 0
this.$emit('comfirmev')
},
cancleEv(){//
this.isZhuan = false
this.current = 0
this.$emit('cancleev')
},
chooseXia(index){
this.current = index
this.$emit('chooseXiaT',this.category[index])
},
openXia(){
this.isZhuan = !this.isZhuan
},
//
chooseXiaTag(index){
let isexistence = this.tagIds.indexOf(this.category[index].id);
this.category[index].checked = !this.category[index].checked;
if(isexistence!=-1){
this.tagIds.splice(isexistence,1);
this.tagVal.splice(isexistence,1)
} else {
this.tagIds.push(this.category[index].id)
this.tagVal.push(this.category[index].title)
}
this.tagStr = this.tagVal.join(',')
//
if(this.tagIds.length==this.category.length){
this.isAll = true;
} else this.isAll = false;
if(!this.tagIds.length) {
this.tagStr = '请选择'
}
this.$emit('chooseXiaT',{arr:this.category,id:this.tagIds.join(',')})
},
//
quanEv(){
this.isAll = !this.isAll;
this.tagIds = [];
this.tagVal = [];
if(this.isAll){
this.category.forEach(item=>{
item.checked = true;
this.tagIds.push(item.id)
this.tagVal.push(item.title)
})
this.tagStr = this.tagVal.join(',')
} else {
this.category.forEach(item=>{item.checked = false;})
this.tagStr = '请选择'
}
this.$emit('chooseXiaT',{arr:this.category,id:this.tagIds.join(',')})
},
}
}
</script>
<style>
</style>

142
components/rate.vue Normal file
View File

@ -0,0 +1,142 @@
<template>
<view class="htz-rate-main">
<template v-for="(item,index) in count">
<image @tap="checkItem((index+1))" class="htz-rate-image" :key="index"
:style="{'width':size+'rpx','height':size+'rpx','padding-right':gutter+'rpx'}"
:src="checkedVal<(index+1)?defImgSrc:selImgSrc"></image>
</template>
</view>
</template>
<script>
export default {
name: 'htz-rate',
props: {
value: { //
type: Number,
default: 0,
},
count: { //
type: Number,
default: 5,
},
size: { //
type: Number,
default: 42,
},
gutter: { //
type: Number,
default: 15,
},
type: { //
type: Number,
default: 0,
},
disHref: { //
type: String,
default: '',
},
checkedHref: { //
type: String,
default: '',
},
readonly: { //
type: Boolean,
default: false,
},
},
data() {
return {
ImgData: ['/static/img/rate/rate1_0.png', '/static/img/rate/rate2_0.png',
'/static/img/rate/rate3_0.png', '/static/img/rate/rate4_0.png', '/static/img/rate/rate5_0.png',
'/static/img/rate/rate6_0.png'
],
defImgSrc: '',
selImgSrc: '',
checkedVal: 0,
}
},
mounted: function() {
this.$nextTick(function() {
this.checkedVal = this.value;
if (this.disHref != '') {
this.defImgSrc = this.disHref;
this.selImgSrc = this.checkedHref;
} else {
//if (this.type != undefined) {
this.defImgSrc = this.ImgData[this.type];
this.selImgSrc = this.ImgData[this.type].replace('_0', '_1');
//}
}
});
},
watch: {
value(val, oldVal) {
this.checkedVal = this.value;
},
},
methods: {
checkItem(index) {
if (!this.readonly) {
this.checkedVal = index;
this.$emit('input', index);
this.$emit('change', index);
}
},
}
}
</script>
<style>
.htz-rate-main {
display: inline-flex;
}
.htz-rate-image {
vertical-align: middle;
}
.htz-image-upload-list {
display: flex;
flex-wrap: wrap;
}
.htz-image-upload-Item {
width: 160rpx;
height: 160rpx;
margin: 13rpx;
border-radius: 10rpx;
position: relative;
}
.htz-image-upload-Item image {
width: 100%;
height: 100%;
border-radius: 10rpx;
}
.htz-image-upload-Item-add {
font-size: 105rpx;
/* line-height: 160rpx; */
text-align: center;
border: 1px dashed #d9d9d9;
color: #d9d9d9;
}
.htz-image-upload-Item-del {
background-color: #f5222d;
font-size: 24rpx;
position: absolute;
width: 35rpx;
height: 35rpx;
line-height: 35rpx;
text-align: center;
top: 0;
right: 0;
z-index: 100;
color: #fff;
}
</style>

132
components/score-list.vue Normal file
View File

@ -0,0 +1,132 @@
<template>
<view class="pad20 shop_list_box">
<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" @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 v-else class="fon24 col3 mar-s20">所有人可买</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" 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" @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 v-else class="fon24 col3 mar-s20">所有人可买</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" class="fon24 col80 mar-s20">{{item1.activity_end_at}}</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
name:"shop-list",
props:{
dataList:{
type:Array,
default:function(){
return [
{
imgSrc:'/static/public/wen-one.png',//
title:'【99皮皮节】【种植发际 线】1000单位FUE技术...',//
zhePrice:'3888',//
yuanPrice:'4205',//
integral:'2888',//
isTuan:false,//
isPing:false,//
isXian:false,//
isIntegral:false,//
grade:0,//
}
]
}
}
},
data() {
return {
newList:[],
timeList:[]//
};
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
methods:{
goPage(id,index){//
uni.navigateTo({
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataList[index].isIntegral}`
})
}
}
}
</script>
<style>
</style>

42
components/shareAll.vue Normal file
View File

@ -0,0 +1,42 @@
<template>
<view>
<view v-if="showShare" @tap="closeShare" style="position: fixed;top: 0;right: 0;left: 0;bottom: 0;background-color: rgba(0,0,0,.5);z-index: 10;">
</view>
<view v-if="showShare" style="display: flex;flex-direction: column;justify-content: space-around;
position: fixed;bottom: 0;left: 0;right: 0;z-index: 100; background-color: #FFFFFF;padding: 40rpx;">
<view class="posir" v-for="(item,index) in cateArr" :key="index" style="display: flex;justify-content: center;align-items: center;flex-direction: column;width: 25%;">
<image style="width: 100rpx;height: 100rpx;margin-bottom: 10rpx;" :src="item.src" mode=""></image>
<view class="fon28 color33">{{item.title}}</view>
<button data-name="shareBtn" open-type="share" plain="true" class="posia" style="top: 0;left: 0;right: 0;bottom: 0;opacity: 0;">分享</button>
</view>
</view>
</view>
</template>
<script>
export default {
name:'shareAll',
props:{
showShare:{
type:Boolean,
default:false
}
},
data() {
return {
cateArr:[
{src:'/static/img/share/weix.png',title:'微信好友'},
]
};
},
methods:{
closeShare(){
this.$emit('closeShare')
}
}
}
</script>
<style>
</style>

171
components/shop-list.vue Normal file
View File

@ -0,0 +1,171 @@
<template>
<view class="pad20 shop_list_box">
<view style="width: 48.6%;float: left;">
<view v-if="index1%2==0" v-for="(item1,index1) in newList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn" @tap="goPage(item1.id,index1)">
<image :src="item1.imgSrc" mode="aspectFill" lazy-load 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 lazy-load 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 lazy-load 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 newList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn" @tap="goPage(item1.id,index1)">
<image :src="item1.imgSrc" lazy-load 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 lazy-load 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 lazy-load 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>
</template>
<script>
export default {
name:"shop-list",
props:{
dataList:{
type:Array,
default:function(){
return []
}
},
iswhere:{
type:Number,
default:0
}
},
data() {
return {
newList:[],
timeList:[],//
timer:''
};
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
mounted() {
if(this.dataList.length!=0){
this.dataList.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);
}
})
this.$toolAll.tools.showToast('加载中...','none',1000);
if(this.timeList!=0){
this.timer = setInterval(()=>{//
if(this.timeList.length!=0){
this.timeList.forEach((item,index)=>{
if(item.id==this.dataList[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.dataList[item.nIndex].activity_end_at = "活动已结束";
} else {
//
this.dataList[item.nIndex].activity_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,this.timeList[index].reponseTime);
}
}
})
}
},1000)
setTimeout(()=>{
this.newList = this.dataList;
},1000)
}
}
},
methods:{
destroyev(){
uni.clearInterval(this.timer);
this.$emit('destroyEv')
},
goPage(id,index){//
let is_activity = 0;
let shopId = 0;
if(this.dataList[index].isTuan==true || this.dataList[index].isPing==true || this.dataList[index].isXian==true) {
is_activity = 1;
shopId = this.dataList[index].activity_id;
} else {
shopId = id;
}
uni.navigateTo({
url:`/pagesB/shopDetail/shopDetail?id=${shopId}&isIntegral=${this.dataList[index].isIntegral}&is_activity=${is_activity}`
})
},
}
}
</script>
<style>
</style>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,143 @@
/* eslint-disable */
var provinceData = [{
"label": "北京市",
"value": "11"
},
{
"label": "天津市",
"value": "12"
},
{
"label": "河北省",
"value": "13"
},
{
"label": "山西省",
"value": "14"
},
{
"label": "内蒙古自治区",
"value": "15"
},
{
"label": "辽宁省",
"value": "21"
},
{
"label": "吉林省",
"value": "22"
},
{
"label": "黑龙江省",
"value": "23"
},
{
"label": "上海市",
"value": "31"
},
{
"label": "江苏省",
"value": "32"
},
{
"label": "浙江省",
"value": "33"
},
{
"label": "安徽省",
"value": "34"
},
{
"label": "福建省",
"value": "35"
},
{
"label": "江西省",
"value": "36"
},
{
"label": "山东省",
"value": "37"
},
{
"label": "河南省",
"value": "41"
},
{
"label": "湖北省",
"value": "42"
},
{
"label": "湖南省",
"value": "43"
},
{
"label": "广东省",
"value": "44"
},
{
"label": "广西壮族自治区",
"value": "45"
},
{
"label": "海南省",
"value": "46"
},
{
"label": "重庆市",
"value": "50"
},
{
"label": "四川省",
"value": "51"
},
{
"label": "贵州省",
"value": "52"
},
{
"label": "云南省",
"value": "53"
},
{
"label": "西藏自治区",
"value": "54"
},
{
"label": "陕西省",
"value": "61"
},
{
"label": "甘肃省",
"value": "62"
},
{
"label": "青海省",
"value": "63"
},
{
"label": "宁夏回族自治区",
"value": "64"
},
{
"label": "新疆维吾尔自治区",
"value": "65"
},
{
"label": "台湾",
"value": "66"
},
{
"label": "香港",
"value": "67"
},
{
"label": "澳门",
"value": "68"
},
{
"label": "钓鱼岛",
"value": "69"
}
]
export default provinceData;

View File

@ -0,0 +1,420 @@
<template>
<view class="simple-address" v-if="showPopup" @touchmove.stop.prevent="clear">
<!-- 遮罩层 -->
<view
class="simple-address-mask"
@touchmove.stop.prevent="clear"
v-if="maskClick"
:class="[ani + '-mask', animation ? 'mask-ani' : '']"
:style="{
'background-color': maskBgColor
}"
@tap="hideMask(true)"
></view>
<view class="simple-address-content simple-address--fixed" :class="[type, ani + '-content', animation ? 'content-ani' : '']">
<view class="simple-address__header">
<view class="simple-address__header-btn-box" @click="pickerCancel">
<text class="simple-address__header-text" :style="{ color: cancelColor, fontSize: btnFontSize }">取消</text>
</view>
<view class="simple-address__header-btn-box" @click="pickerConfirm">
<text class="simple-address__header-text" :style="{ color: confirmColor || themeColor, fontSize: btnFontSize }">确定</text>
</view>
</view>
<view class="simple-address__box">
<picker-view indicator-style="height: 70rpx;" class="simple-address-view" :value="pickerValue" @change="pickerChange">
<picker-view-column>
<!-- #ifndef APP-NVUE -->
<view class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in provinceDataList" :key="index">{{ item.label }}</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<text class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in provinceDataList" :key="index">{{ item.label }}</text>
<!-- #endif -->
</picker-view-column>
<picker-view-column>
<!-- #ifndef APP-NVUE -->
<view class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in cityDataList" :key="index">{{ item.label }}</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<text class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in cityDataList" :key="index">{{ item.label }}</text>
<!-- #endif -->
</picker-view-column>
<picker-view-column>
<!-- #ifndef APP-NVUE -->
<view class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in areaDataList" :key="index">{{ item.label }}</view>
<!-- #endif -->
<!-- #ifdef APP-NVUE -->
<text class="picker-item" :style="{ fontSize: fontSize }" v-for="(item, index) in areaDataList" :key="index">{{ item.label }}</text>
<!-- #endif -->
</picker-view-column>
</picker-view>
</view>
</view>
</view>
</template>
<script>
/**
* Simple-addres 地址联动组件
* @description 三级地址联动支持appnvue小程序H5
* @tutorial https://ext.dcloud.net.cn/plugin?id=1084
* @property {String} animation 是否开启动画
* @property {String} type = [bottom] 弹出层类型暂时只支持底部弹出
* @property {Boolean} maskClick = [true | false] 是否允许点击遮罩层关闭
* @property {Boolean} show = [true | false] 显示或隐藏地址组件
* @property {String} maskBgColor 遮罩层背景颜色
* @property {String} cancelColor 取消按钮颜色默认为#1aad19
* @property {String} confirmColor 确认按钮颜色默认为themeColor
* @property {String} themeColor 主题颜色后续会废弃该配置建议使用`cancelColor``confirmColor`
* @property {String} btnFontSize 取消确认按钮字体大小默认为`uni.scss里的 $uni-font-size-base `
* @property {String} fontSize picker-item字体大小默认为28rpx
* @property {Array} pickerValueDefault 默认值可以通过function queryIndex 获取
* @property {Function} queryIndex 根据自定义信息返回对应的index
* @property {Function} open 打开
* @example <simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor='#007AFF'></simple-address>
*/
import provinceData from './city-data/province.js';
import cityData from './city-data/city.js';
import areaData from './city-data/area.js';
export default {
name: 'simpleAddress',
props: {
mode: {
//
// default index
//
type: String,
default: 'default'
},
//
animation: {
type: Boolean,
default: true
},
/*
bottom底部弹出层
*/
type: {
type: String,
default: 'bottom'
},
// maskClick
maskClick: {
type: Boolean,
default: true
},
show: {
type: Boolean,
default: true
},
maskBgColor: {
type: String,
default: 'rgba(0, 0, 0, 0.4)' // rgba(0, 0, 0, 0.4) uni.scss
},
themeColor: {
type: String,
default: '' //
},
cancelColor: {
type: String,
default: '' //
},
confirmColor: {
type: String,
default: '' //
},
fontSize: {
type: String,
default: '28rpx' // picker-item
},
btnFontSize: {
type: String,
default: '' //
},
/* 默认值 */
pickerValueDefault: {
type: Array,
default() {
return [0, 0, 0];
}
}
},
data() {
return {
ani: '',
showPopup: false,
pickerValue: [0, 0, 0],
provinceDataList: [],
cityDataList: [],
areaDataList: []
};
},
watch: {
show(newValue) {
if (newValue) {
this.open();
} else {
this.close();
}
},
pickerValueDefault() {
this.init();
}
},
created() {
this.init();
},
methods: {
init() {
this.handPickValueDefault(); // pickerValueDefault
this.provinceDataList = provinceData;
this.cityDataList = cityData[this.pickerValueDefault[0]];
this.areaDataList = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]];
this.pickerValue = this.pickerValueDefault;
},
handPickValueDefault() {
if (this.pickerValueDefault !== [0, 0, 0]) {
if (this.pickerValueDefault[0] > provinceData.length - 1) {
this.pickerValueDefault[0] = provinceData.length - 1;
}
if (this.pickerValueDefault[1] > cityData[this.pickerValueDefault[0]].length - 1) {
this.pickerValueDefault[1] = cityData[this.pickerValueDefault[0]].length - 1;
}
if (this.pickerValueDefault[2] > areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1) {
this.pickerValueDefault[2] = areaData[this.pickerValueDefault[0]][this.pickerValueDefault[1]].length - 1;
}
}
},
pickerChange(e) {
let changePickerValue = e.detail.value;
if (this.pickerValue[0] !== changePickerValue[0]) {
//
this.cityDataList = cityData[changePickerValue[0]];
this.areaDataList = areaData[changePickerValue[0]][0];
changePickerValue[1] = 0;
changePickerValue[2] = 0;
} else if (this.pickerValue[1] !== changePickerValue[1]) {
//
this.areaDataList = areaData[changePickerValue[0]][changePickerValue[1]];
changePickerValue[2] = 0;
}
this.pickerValue = changePickerValue;
this._$emit('onChange');
},
_$emit(emitName) {
let pickObj = {
label: this._getLabel(),
value: this.pickerValue,
cityCode: this._getCityCode(),
areaCode: this._getAreaCode(),
provinceCode: this._getProvinceCode(),
labelArr: this._getLabel().split('-')
};
this.$emit(emitName, pickObj);
},
_getLabel() {
let pcikerLabel =
this.provinceDataList[this.pickerValue[0]].label + '-' + this.cityDataList[this.pickerValue[1]].label + '-' + this.areaDataList[this.pickerValue[2]].label;
return pcikerLabel;
},
_getCityCode() {
return this.cityDataList[this.pickerValue[1]].value;
},
_getProvinceCode() {
return this.provinceDataList[this.pickerValue[0]].value;
},
_getAreaCode() {
return this.areaDataList[this.pickerValue[2]].value;
},
queryIndex(params = [], type = 'value') {
// params = [ 11 ,1101,110101 ];
// 1.index
let provinceIndex = provinceData.findIndex(res => res[type] == params[0]);
let cityIndex = cityData[provinceIndex].findIndex(res => res[type] == params[1]);
let areaIndex = areaData[provinceIndex][cityIndex].findIndex(res => res[type] == params[2]);
return {
index: [provinceIndex, cityIndex, areaIndex],
data: {
province: provinceData[provinceIndex],
city: cityData[provinceIndex][cityIndex],
area: areaData[provinceIndex][cityIndex][areaIndex]
}
};
},
clear() {},
hideMask() {
this._$emit('onCancel');
this.close();
},
pickerCancel() {
this._$emit('onCancel');
this.close();
},
pickerConfirm() {
this._$emit('onConfirm');
this.close();
},
open() {
this.showPopup = true;
this.$nextTick(() => {
setTimeout(() => {
this.ani = 'simple-' + this.type;
}, 100);
});
},
close(type) {
if (!this.maskClick && type) return;
this.ani = '';
this.$nextTick(() => {
setTimeout(() => {
this.showPopup = false;
}, 300);
});
}
}
};
</script>
<style lang="scss" scoped>
.simple-address {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: column;
}
.simple-address-mask {
position: fixed;
bottom: 0;
top: 0;
left: 0;
right: 0;
transition-property: opacity;
transition-duration: 0.3s;
opacity: 0;
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
}
.mask-ani {
transition-property: opacity;
transition-duration: 0.2s;
}
.simple-bottom-mask {
opacity: 1;
}
.simple-center-mask {
opacity: 1;
}
.simple-address--fixed {
position: fixed;
bottom: 0;
left: 0;
right: 0;
transition-property: transform;
transition-duration: 0.3s;
transform: translateY(460rpx);
/* #ifndef APP-NVUE */
z-index: 99;
/* #endif */
}
.simple-address-content {
background-color: #ffffff;
}
.simple-content-bottom {
bottom: 0;
left: 0;
right: 0;
transform: translateY(500rpx);
}
.content-ani {
transition-property: transform, opacity;
transition-duration: 0.2s;
}
.simple-bottom-content {
transform: translateY(0);
}
.simple-center-content {
transform: scale(1);
opacity: 1;
}
.simple-address__header {
position: relative;
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
border-bottom-color: #f2f2f2;
border-bottom-style: solid;
border-bottom-width: 1rpx;
}
.simple-address--fixed-top {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
justify-content: space-between;
border-top-color: $uni-border-color;
border-top-style: solid;
border-top-width: 1rpx;
}
.simple-address__header-btn-box {
/* #ifndef APP-NVUE */
display: flex;
/* #endif */
flex-direction: row;
align-items: center;
justify-content: center;
height: 70rpx;
}
.simple-address__header-text {
text-align: center;
font-size: $uni-font-size-base;
color: #1aad19;
line-height: 70rpx;
padding-left: 40rpx;
padding-right: 40rpx;
}
.simple-address__box {
position: relative;
}
.simple-address-view {
position: relative;
bottom: 0;
left: 0;
/* #ifndef APP-NVUE */
width: 100%;
/* #endif */
/* #ifdef APP-NVUE */
width: 750rpx;
/* #endif */
height: 408rpx;
background-color: rgba(255, 255, 255, 1);
}
.picker-item {
text-align: center;
line-height: 70rpx;
text-overflow: ellipsis;
font-size: 28rpx;
}
</style>

111
components/status-nav.vue Normal file
View File

@ -0,0 +1,111 @@
<template>
<view class="status-box statusHNH">
<view :style="{height:statusBarHeight+'px',background:backgroudColor}"></view>
<view class="status-nav-box" :style="{background:backgroudColor}">
<!-- 返回键 -->
<view @tap="backEvent" v-if="statusBack" style="height: 33rpx;width: 120rpx;flex-shrink: 0;position: absolute;">
<image v-if="backColor==0" class="tab-back" src="/static/public/backBlackm.png"></image>
<image v-if="backColor==1" class="tab-back" src="/static/public/videoBack.png"></image>
</view>
<!-- 标题 -->
<!-- <view v-if="statusTitle" :class="statusBack ? 'tcenter' : 'tleft'" class="tab-title" :style="{color:tabcolor}">{{titleVal}}</view> -->
<view v-if="statusTitle" class="tab-title tcenter" :style="{color:tabcolor}">{{titleVal}}</view>
<view v-else class="tab-title tcenter" :style="{color:tabcolor}"> </view>
</view>
</view>
</template>
<script>
export default {
name:'status-nav',
props:{
statusTitle:{//
type:Boolean,
default:false
},
statusBack:{//
type:Boolean,
default:true
},
backgroudColor:{//
type:String,
default:'#FFFFFF'
},
tabcolor:{//
type:String,
default:'#333333'
},
titleVal:{//
type:String,
default:''
},
whereCome:{//
type:Number,
default:0
},
backColor:{//
type:Number,
default:0
}
},
mounted() {
// +
const query = wx.createSelectorQuery().in(this)
query.select('.statusHNH').boundingClientRect((rect) => {
// console.log('+',rect.height);
uni.setStorageSync('statusHNH',rect.height);
this.$store.commit('updateHeightEv',rect.height)
}).exec()
//
let pages = getCurrentPages(); //
let currentPage = pages[pages.length - 1]; //
// console.log(currentPage.route,'');
// console.log(currentPage.$page.fullPath,'');
uni.setStorageSync('url',`/${currentPage.route}`);
uni.setStorageSync('paramsUrl',currentPage.$page.fullPath);
// console.log(uni.getStorageSync('paramsUrl'),66);
// console.log(uni.getStorageSync('url'),64);
},
data() {
return {
statusBarHeight:uni.getSystemInfoSync().statusBarHeight,//
};
},
methods:{
backEvent(){//
if(getApp().globalData.outside){
this.whereCome = 6;
}
switch (this.whereCome){
case 0:
uni.navigateBack({delta:1})
break;
case 1:
case 6:
uni.removeStorageSync('outside');
uni.reLaunch({
url:'/pages/tabbar/pagehome/pagehome'
})
break;
case 2:
uni.reLaunch({
url:'/pages/tabbar/my/staffDuan'
})
break;
default:
break;
}
}
}
}
</script>
<style scoped>
.status-box{position: fixed;top: 0;left: 0;right: 0;z-index: 10;}
.status-nav-box{width: 100%;position: relative;padding: 30rpx 0; display: flex;align-items: center;}
.tab-back{width: 33rpx;height: 33rpx;flex-shrink: 0;position: absolute;left: 20rpx;}
.tab-title{font-size: 36rpx;font-weight: bold;color: #333333;width: 100%;}
.tcenter{text-align: center;}
.tleft{margin-left: 40rpx;}
</style>

126
components/swiper-pu.vue Normal file
View File

@ -0,0 +1,126 @@
<template>
<view>
<view v-if="isDot" class="banner-box">
<swiper :current="bcurrent" @change="changeBanner" :style="{height: newHeight+'px'}" :autoplay="isplay" :circular="true" :interval="3000" :duration="500">
<swiper-item v-for="(item,index) in bannerList" :key="index">
<view @tap="chooseImg(index)" class="posir">
<image lazy-load :style="{borderRadius:newRadius+'px',height:newHeight+'px'}" class="img" :src="item.imgSrc" mode="aspectFill"></image>
<image lazy-load @tap.stop="playVideo(index)" v-if="item.isVideo && isVedio" class="posia" style="top: 50%;left: 50%;transform: translate(-50%,-50%);width: 126rpx;height: 126rpx;z-index: 1;" src="/static/public/video.png" mode=""></image>
</view>
</swiper-item>
</swiper>
<!-- 指示点 -->
<view class="dot-box" :style="{bottom:newBottom+'px'}">
<view :class="bcurrent==indexd ? 'dotActive' : 'dotMo'" v-for="(itemd,indexd) in bannerList.length" :key="indexd"></view>
</view>
</view>
</view>
</template>
<script>
export default {
name:"swiper-pu",
props:{
isplay:{
type:Boolean,
default:false
},
isDot:{//
type:Boolean,
default:true
},
bannerList:{//
type:Array,
default:function(){
return [
{imgSrc:'/static/public/banner.png',url:'',isVideo:false,poster:''},
{imgSrc:'/static/public/banner.png',url:'',isVideo:false,poster:''},
]
}
},
newHeight:{//swiper
type:String,
default:'200'
},
newBottom:{//
type:String,
default:'18'
},
newRadius:{//
type:String,
default:'0'
},
browseP:{
type:Boolean,
default:false
}
},
data() {
return {
bcurrent:0,
isShowVideo:false,
autoplay:false,
isVedio:false
};
},
mounted() {
this.$requst.get('index/base-config').then(res=>{
res.data.v==0 ? this.isVedio = false : this.isVedio = true;
})
},
methods:{
chooseImg(index){
// console.log('banner',index);
this.bcurrent = index
if(this.browseP){
let imgList = []
this.bannerList.forEach(item=>{
let nurl = ''
let obj = {}
if(this.isVedio) {
item.url=='' ? nurl = item.imgSrc : nurl = item.url
obj = {
url:nurl,
type:item.isVideo?'video':'image',
poster:item.poster
}
} else {
nurl = item.imgSrc
obj = {
url:nurl,
type:'image',
poster:item.poster
}
}
imgList.push(obj)
})
uni.previewMedia({
current:this.bcurrent,
sources:imgList
})
} else {
uni.navigateTo({
url:this.bannerList[index].url
})
}
},
changeBanner(e){
this.bcurrent = e.detail.current//
},
playVideo(index){
// console.log('');
uni.navigateTo({
url:`/pagesB/video/playVideo?src=${this.bannerList[index].url}&posterSrc=${this.bannerList[index].poster}`
})
}
}
}
</script>
<style scoped>
.banner-box{position: relative;}
.img{width:100%;}
.dot-box{position: absolute;bottom: 36rpx;display: flex;justify-content: center;width: 100%;}
.dotActive{width: 22rpx;height: 12rpx;margin-right: 10rpx;border-radius: 20rpx; background-color: rgba(56, 117, 246, .5);}
.dotMo{width: 12rpx;height: 12rpx;margin-right: 10rpx;border-radius: 100%;background-color: rgba(191, 191, 191, 0.5);}
</style>

View File

@ -0,0 +1,86 @@
## 功能描述
根据内容生成二维码,并返回图片地址
## 平台兼容性
兼容APP、H5及微信小程序。其他平台未测试
## 安装方式
安装到components文件夹支持[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)组件模式。
## 使用方式
**<font color=#FF0000 >可根据属性自定义二维码</font>**
``` javascript
<yz-qr></yz-qr>
```
## 属性说明
|属性名 |类型 |默认值 |说明 |
|-- |-- |-- |-- |
|text |String |'hello' |二维码内容 |
|size |Number |340 |单位是px |
|colorDark |String |'#000000' |黑色二维码 |
|colorLight |String |'#ffffff' |白色背景 |
## 示例代码
``` javascript
<template>
<view class="content">
<!-- 通过 ref 为子组件赋予一个 ID 引用,访问子组件实例 -->
<yz-qr ref="qrPath" :text="text" :size="size" :colorDark="colorDark" :colorLight="colorLight"></yz-qr>
<view class="text">
二维码内容:<text>{{text}}</text>
</view>
<view class="text">
图片地址:<text>{{canvasQrPath}}</text>
</view>
</view>
</template>
<script>
export default {
data() {
return {
canvasQrPath: '',
text: 'hello',
size: 200,
colorDark: '#ff0000',
colorLight: '#ffffff'
}
},
onLoad() {
this.getQrPath()
},
methods: {
getQrPath() {
var that = this;
setTimeout(function() {
that.canvasQrPath = that.$refs.qrPath.canvasQrPath;
console.log('获取二维码地址:', that.canvasQrPath)
}, 1000)
}
}
}
</script>
<style>
.text {
background-color: #f3f3f3;
margin: 24rpx;
padding: 24rpx;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.text text {
font-weight: 700;
margin-left: 16rpx;
}
</style>
```
## <font color=#FF0000 >canvas踩坑</font>
1. uni-app中的canvas的width、height的值依赖于父元素的宽高。canvas的父级如果被隐藏。canvas的width、height则都为0。
2. 当父元素出现canvas的高度也就有了。但是canvas并不会绘制显示。解决方法可以将绘制方法写在异步方法中同时要注意组件的生命周期确保实例挂载成功之后再执行。

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,81 @@
<template>
<view>
<view class="qrcode">
<canvas :style="{width:size+ 'px', height:size+ 'px', background:bgc}" canvas-id="couponQrcode"></canvas>
</view>
</view>
</template>
<script>
const qrCode = require('./weapp-qrcode.js')
export default {
data() {
return {
bgc: 'rgba(200, 200, 200, 0.1)', //
canvasQrPath: '', //
}
},
props: {
text: {
type: String,
default: 'hello'
},
size: {
type: Number,
default: 340
},
colorDark: {
type: String,
default: '#000000'
},
colorLight: {
type: String,
default: '#ffffff'
},
},
//
created() {
setTimeout(() => {
this.couponQrCode()
}, 0)
},
methods: {
//
couponQrCode() {
var that = this;
new qrCode('couponQrcode', {
text: this.text,
width: this.size,
height: this.size,
showLoading: true, // loading
loadingText: '二维码生成中', // loading
colorDark: this.colorDark, //
colorLight: this.colorLight, //
correctLevel: qrCode.CorrectLevel.H, //L/M/Q/H
usingIn: this //this
})
//
uni.canvasToTempFilePath({
canvasId: 'couponQrcode',
success: function(res) {
// H5tempFilePath base64
console.log('yz-qr图片路径:',res.tempFilePath)
that.canvasQrPath = res.tempFilePath
}
}, this)
this.$emit('update:canvasQrPath', that.canvasQrPath)
}
}
}
</script>
<style>
.qrcode {
padding: 24rpx;
display: flex;
align-items: center;
justify-content: center;
}
</style>

201
jsFile/base64-src.js Normal file
View File

@ -0,0 +1,201 @@
function getLocalFilePath(path) {
if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path.indexOf(
'_downloads') === 0) {
return path
}
if (path.indexOf('file://') === 0) {
return path
}
if (path.indexOf('/storage/emulated/0/') === 0) {
return path
}
if (path.indexOf('/') === 0) {
var localFilePath = plus.io.convertAbsoluteFileSystem(path)
if (localFilePath !== path) {
return localFilePath
} else {
path = path.substr(1)
}
}
return '_www/' + path
}
function dataUrlToBase64(str) {
var array = str.split(',')
return array[array.length - 1]
}
var index = 0
function getNewFileId() {
return Date.now() + String(index++)
}
function biggerThan(v1, v2) {
var v1Array = v1.split('.')
var v2Array = v2.split('.')
var update = false
for (var index = 0; index < v2Array.length; index++) {
var diff = v1Array[index] - v2Array[index]
if (diff !== 0) {
update = diff > 0
break
}
}
return update
}
export function pathToBase64(path) {
return new Promise(function(resolve, reject) {
if (typeof window === 'object' && 'document' in window) {
if (typeof FileReader === 'function') {
var xhr = new XMLHttpRequest()
xhr.open('GET', path, true)
xhr.responseType = 'blob'
xhr.onload = function() {
if (this.status === 200) {
let fileReader = new FileReader()
fileReader.onload = function(e) {
resolve(e.target.result)
}
fileReader.onerror = reject
fileReader.readAsDataURL(this.response)
}
}
xhr.onerror = reject
xhr.send()
return
}
var canvas = document.createElement('canvas')
var c2x = canvas.getContext('2d')
var img = new Image
img.onload = function() {
canvas.width = img.width
canvas.height = img.height
c2x.drawImage(img, 0, 0)
resolve(canvas.toDataURL())
canvas.height = canvas.width = 0
}
img.onerror = reject
img.src = path
return
}
if (typeof plus === 'object') {
plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), function(entry) {
entry.file(function(file) {
var fileReader = new plus.io.FileReader()
fileReader.onload = function(data) {
resolve(data.target.result)
}
fileReader.onerror = function(error) {
reject(error)
}
fileReader.readAsDataURL(file)
}, function(error) {
reject(error)
})
}, function(error) {
reject(error)
})
return
}
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
wx.getFileSystemManager().readFile({
filePath: path,
encoding: 'base64',
success: function(res) {
resolve('data:image/png;base64,' + res.data)
},
fail: function(error) {
reject(error)
}
})
return
}
reject(new Error('not support'))
})
}
export function base64ToPath(base64) {
return new Promise(function(resolve, reject) {
if (typeof window === 'object' && 'document' in window) {
base64 = base64.split(',')
var type = base64[0].match(/:(.*?);/)[1]
var str = atob(base64[1])
var n = str.length
var array = new Uint8Array(n)
while (n--) {
array[n] = str.charCodeAt(n)
}
return resolve((window.URL || window.webkitURL).createObjectURL(new Blob([array], {
type: type
})))
}
var extName = base64.split(',')[0].match(/data\:\S+\/(\S+);/)
if (extName) {
extName = extName[1]
} else {
reject(new Error('base64 error'))
}
var fileName = getNewFileId() + '.' + extName
if (typeof plus === 'object') {
var basePath = '_doc'
var dirPath = 'uniapp_temp'
var filePath = basePath + '/' + dirPath + '/' + fileName
if (!biggerThan(plus.os.name === 'Android' ? '1.9.9.80627' : '1.9.9.80472', plus.runtime
.innerVersion)) {
plus.io.resolveLocalFileSystemURL(basePath, function(entry) {
entry.getDirectory(dirPath, {
create: true,
exclusive: false,
}, function(entry) {
entry.getFile(fileName, {
create: true,
exclusive: false,
}, function(entry) {
entry.createWriter(function(writer) {
writer.onwrite = function() {
resolve(filePath)
}
writer.onerror = reject
writer.seek(0)
writer.writeAsBinary(dataUrlToBase64(base64))
}, reject)
}, reject)
}, reject)
}, reject)
return
}
var bitmap = new plus.nativeObj.Bitmap(fileName)
bitmap.loadBase64Data(base64, function() {
bitmap.save(filePath, {}, function() {
bitmap.clear()
resolve(filePath)
}, function(error) {
bitmap.clear()
reject(error)
})
}, function(error) {
bitmap.clear()
reject(error)
})
return
}
if (typeof wx === 'object' && wx.canIUse('getFileSystemManager')) {
var filePath = wx.env.USER_DATA_PATH + '/' + fileName
wx.getFileSystemManager().writeFile({
filePath: filePath,
data: dataUrlToBase64(base64),
encoding: 'base64',
success: function() {
resolve(filePath)
},
fail: function(error) {
reject(error)
}
})
return
}
reject(new Error('not support'))
})
}

144
jsFile/publicAPI.js Normal file
View File

@ -0,0 +1,144 @@
import requst from './requst.js';
import toolAll from './tools.js';
import store from '@/store/index.js'
export function collectionEV(data){//收藏事件
return requst.post('archives/record',data).then(res=>{
if(res.code==0) {
let newMsg = '点赞成功'
let num = 2
if(data.action=='collect'){
num = 3
newMsg = '收藏成功'
}
let maiOjb = {
e:num,//内容收藏
c:data.archive_id*1,
t:new Date().getTime()//当前时间戳
}
toolAll.tools.maiDian(maiOjb)
toolAll.tools.showToast(newMsg,'none',1500)
}
},error=>{})
}
export function cancleCollectionEV(data){//取消收藏事件
return requst.post('archives/un-record',data).then(res=>{
if(res.code==0) {
let newMsg = '已取消点赞'
if(data.action=='collect'){
newMsg = '已取消收藏'
}
toolAll.tools.showToast(newMsg,'none',1500)
}
},error=>{})
}
// 商品收藏、积分收藏
export function collectionShopEV(data){//收藏事件
console.log(data);
return requst.post('spu/record',data).then(res=>{
if(res.code==0) {
let newMsg = ''
let num = 0
if(data.action=='collect'){
num = 3
newMsg = '收藏成功'
}
let maiOjb = {
e:num,//内容收藏
c:data.id*1,
t:new Date().getTime()//当前时间戳
}
toolAll.tools.maiDian(maiOjb)
toolAll.tools.showToast(newMsg,'none',1500)
}
},error=>{})
}
export function cancleCollectionShopEV(data){//取消收藏事件
return requst.post('spu/un-record',data).then(res=>{
if(res.code==0) {
let newMsg = ''
if(data.action=='collect'){
newMsg = '已取消收藏'
}
toolAll.tools.showToast(newMsg,'none',1500)
}
},error=>{})
}
export function buriedPoint(){//查询埋点类型事件
return requst.post('statistics/event').then(res=>{
// console.log('查询所有需要埋点的类型:',res);
if(res.code==0) uni.setStorageSync('buriedPoint',res.data)
},error=>{})
}
export function reportBuriedPoint(data){//上报埋点事件
// console.log('埋点的数据:',data);
return requst.post('statistics/report',data).then(res=>{},error=>{})
}
export function themeEv(){//查询主题色
return requst.post('index/mini-program-setting','',false).then(res=>{
if(res.code==0){
if(res.data.length!=0){
let imgList = [];
let titleList = [];
if(res.data.footBar.length!=0){//底部导航
res.data.footBar.forEach(item=>{
let newName = item.name
let newObj = {
iconPath:'https://oss.hmzfyy.cn' + item.icon[0],
selectedIconPath:'https://oss.hmzfyy.cn' + item.icon[1],
}
if(item.key=="home"){
imgList[0] = newObj
titleList[0] = newName
}
if(item.key=="category"){
imgList[1] = newObj
titleList[1] = newName
}
if(item.key=="service"){
imgList[2] = newObj
titleList[2] = newName
}
if(item.key=="shop"){
imgList[3] = newObj
titleList[3] = newName
}
if(item.key=="my"){
imgList[4] = newObj
titleList[4] = newName
}
})
store.commit('updateState', {
titleList,
imgList,
publicColor:res.data.mainColor
})
}
}
}
})
}
export function checkSwip(){//查询主题色
return requst.post('common/slide-positions').then(res=>{
if(res.code==0){
console.log(res);
}
},error=>{})
}
export function checkBanner(data){//查询banner
return requst.post('common/slides',data,false)
}
export function checkQuan(){//查询优惠券
return requst.post('user/home-coupon',{},false).then(res=>{
if(res.code==0){
if(res.data.has_coupon==1){
uni.setStorageSync('isQuan',true);
uni.setStorageSync('quanImg','https://oss.hmzfyy.cn' + res.data.home_coupon.cover);
uni.setStorageSync('quanId',res.data.home_coupon.id);
} else {
uni.setStorageSync('isQuan',false);
}
}
})
}

212
jsFile/requst.js Normal file
View File

@ -0,0 +1,212 @@
const ENV = process.env;
let hostapi = 'https://dxscrm.scdxtc.com/';
// 请求错误处理
const checkError = (e) => {
// console.error("----接口错误----", e)
if (e.data) {
if (e.data.code) {
switch (Number(e.data.code)) {
case 4003:
// 参数错误
console.log('4003参数错误');
break;
case 4004:
// 记录不存在
console.log('4004记录不存在');
break;
case 5001:
// xxx错误
console.log('5001xxx错误');
break;
case 5050:
// 服务器错误,请稍后重试
console.log('5050服务器错误请稍后重试');
break;
case 5051:
// 未知错误
console.log('5051未知错误');
break;
case 6001:
console.log('6001token验证失败或已失效');
break;
}
}
}
}
let flag = true;
// 封装请求
const request = (method, url, options, ifLogin) => {
let methods = '';
let headers = {};
switch (method) {
case 'get':
methods = 'GET'
headers = {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
}
break;
case 'post':
methods = 'POST'
headers = {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
}
break;
case 'postForm':
methods = 'POST'
headers = {
'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
}
break;
}
return new Promise((resolve, reject) => {
// 不需要登录
if(flag) {
uni.request({
url: `${hostapi}${url}`,
method: methods,
data: options,
header: headers,
success: res => {
console.log(`${url}接口返的结果===>`,res);
if (res.statusCode == 200) {
if (res.data.code == 0) {
resolve(res.data)
} else {
if(res.data.code==6001) {
flag = false;
uni.login({
provider: 'weixin',
success: (res)=> {
var params = {code:res.code}
uni.request({
url: `${hostapi}user/login`,
method: 'post',
data: params,
success: res => {
if(res.data.data.token!=''){
flag = true;
uni.setStorageSync('token',res.data.data.token); // 缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存openid
uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active',res.data.data.phone_active); // 是否绑定手机号
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
uni.reLaunch({ // 重新进入当前页面
url:uni.getStorageSync('paramsUrl')
})
}
}
})
},
});
} else {
checkError(res)
}
// uni.showToast({
// title:res.data.msg,
// icon:'none'
// })
}
} else if(res.statusCode==500) {
flag = false;
uni.login({
provider: 'weixin',
success: (res)=> {
var params = {code:res.code}
uni.request({
url: `${hostapi}user/login`,
method: 'post',
data: params,
success: res => {
if(res.data.data.token!=''){
flag = true;
uni.setStorageSync('token',res.data.data.token); // 缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存openid
uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active',res.data.data.phone_active); // 是否绑定手机号
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
uni.reLaunch({ // 重新进入当前页面
url:uni.getStorageSync('paramsUrl')
})
}
}
})
},
});
} else {
checkError(res)
}
},
fail: e => {
checkError(e)
},
complete: rest => {
// console.log(rest);
}
})
}
})
}
// 上传文件 封装请求
const uploadFile = (url, options) => {
let tempData = options || {}
return new Promise((resolve, reject) => {
uni.uploadFile({
url: `${hostapi}${url}`,
filePath: tempData.file,
name: 'image',
fileType:'image',
formData: tempData,
header: {
'Content-Type': 'multipart/form-data;charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: res => {
if (res.statusCode == 200) {
let temp = JSON.parse(res.data)
if (temp.code == 0) {
resolve(temp)
} else {
reject(temp)
uni.showToast({
title: temp.msg || '接口错误(' + temp.code + ')',
icon: 'none'
})
}
} else {
uni.showToast({
title: `未知错误(${res.statusCode})`,
icon: 'none'
})
}
},
fail(e) {},
complete: () => {
uni.hideLoading()
}
});
})
}
export default {
get: (url, options, ifLogin=true) => {
return request('get', url, options, ifLogin)
},
// JOSN格式
post: (url, options, ifLogin=true) => {
return request('post', url, options, ifLogin)
},
// form-data格式
postForm: (url, options, ifLogin=true) => {
return request('postForm', url, options, ifLogin)
},
// 上传
upload: (url, options, ifLogin=true) => {
return uploadFile(url, options, ifLogin)
}
}

11
jsFile/share.js Normal file
View File

@ -0,0 +1,11 @@
export default {
onShareAppMessage(res) { //发送给朋友
return {
title: '', // 默认是小程序的名称(可以写slogan等)
path: `${uni.getStorageSync('url')}?invite_code=${uni.getStorageSync('invite_code')}` // 默认是当前页面,必须是以‘/’开头的完整路径
}
},
onShareTimeline(res) {//分享到朋友圈
return {}
},
}

407
jsFile/tools.js Normal file
View File

@ -0,0 +1,407 @@
import {buriedPoint,reportBuriedPoint,checkQuan} from './publicAPI.js';
import state from '@/store/index.js';
const tools = {
timer:'',
// 埋点倒计时
daoTime(){
let daoTime = uni.getStorageSync('daoTime')
if(daoTime==''){//初次判断倒计时是否为空
uni.setStorageSync('daoTime',60)//设置倒计时
daoTime = uni.getStorageSync('daoTime')
this.timer = setInterval(()=>{
uni.setStorageSync('daoTime',daoTime--)//设置倒计时
// console.log('埋点倒计时初次:',daoTime);
// console.log('埋点长度初次:',uni.getStorageSync('maiList').length);
if(uni.getStorageSync('daoTime')<=0 || uni.getStorageSync('maiList').length==5){
uni.removeStorageSync('daoTime')//清空倒计时
clearInterval(this.timer)//关闭倒计时
// console.log('上/报,埋点');
reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件
uni.removeStorageSync('maiList')//清空上报参数
this.daoTime()//重新倒计时
}
},1000)
} else {//继续当前倒计时倒计
this.timer = setInterval(()=>{
uni.setStorageSync('daoTime',daoTime--)//设置倒计时
// console.log('埋点倒计时:',daoTime);
// console.log('埋点长度:',uni.getStorageSync('maiList').length);
if(uni.getStorageSync('daoTime')<=0 || uni.getStorageSync('maiList').length==5){
uni.removeStorageSync('daoTime')//清空倒计时
clearInterval(this.timer)//关闭倒计时
// console.log('上报,埋点');
reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件
uni.removeStorageSync('maiList')//清空上报参数
this.daoTime()//重新倒计时
}
},1000)
}
},
// 关闭埋点倒计时
closeTimer(){
clearInterval(this.timer);
console.log('倒计时清空了');
},
// 设置埋点数据事件
maiDian(data){
let maiList = uni.getStorageSync('maiList')
// console.log(maiList);
if(maiList==''){
maiList = [data]
} else maiList.push(data)
uni.setStorageSync('maiList',maiList)
},
// 种植埋点
plantPoint(num, id=''){
console.log(num,id,67);
let maiOjb = {
e: num, //内容访问
c: id * 1,
t: new Date().getTime() //当前时间戳
}
this.maiDian(maiOjb);
},
// 立即执行埋点上报
reportImmediately() {
reportBuriedPoint(uni.getStorageSync('maiList'))//上报事件
},
// 查券
checkQuan(){
checkQuan();
},
networkStatus(){//检查网络状态
uni.getNetworkType({
success: function (res) {
console.log('当前网络状态:',res.networkType);//none当前无网络连接
if(res.networkType=='none'){
uni.setStorageSync('isNet',false)
} else {
uni.setStorageSync('isNet',true)
}
}
});
},
buriedPointAll(){//查询埋点类型事件
buriedPoint()
},
weekDate(){//获取未来七天星期几,几号
let date = new Date()
let year = date.getFullYear()
let month = date.getMonth()+1
let day = date.getDate()
let nth = date.getDay()//星期几
let xingq = ['周一','周二','周三','周四','周五','周六','周日']
},
// 手机号验证
isPhone:function(phone){
// 手机号正则表达式
let reg_tel = /^(13[0-9]|14[01456879]|15[0-35-9]|16[2567]|17[0-8]|18[0-9]|19[0-35-9])\d{8}$/;
if(!reg_tel.test(phone)){
return true
}
return false
},
// 手机号中间四位用"****"带替
hideMPhone(phone){
return `${phone.substr(0, 3)}****${phone.substr(7)}`
},
// 显示中文第一个字,其余的使用"*"代替
hideName(name,num){
return `${name.substr(0, 1)}****${name.substr(name.length-1)}` || ''
},
// 整数添加.00,小数就不添加
addXiaoShu(num){
let str = num.toString();
if(str.length > 9){
str = str*1;
str = str.toFixed(2);
str = str+'';
}
return str.includes('.') ? str*1 : str = num + '.00';
},
// 时间戳===>日期
timestampToTime(timestamp) {
var date = timestamp.toString().length==13 ? new Date(timestamp*1) : new Date(timestamp * 1000);//时间戳为10位需*1000时间戳为13位的话不需乘1000
var Y = date.getFullYear();
var M = (date.getMonth()+1 < 10 ? '0'+(date.getMonth()+1) : date.getMonth()+1);
var D = date.getDate() < 10 ? '0'+date.getDate() : date.getDate();
var h = date.getHours() < 10 ? '0'+date.getHours() : date.getHours();
var m = date.getMinutes() < 10 ? '0'+date.getMinutes() : date.getMinutes();
var s = date.getSeconds() < 10 ? '0'+date.getSeconds() : date.getSeconds();
return Y + '-' + M + '-' + D + ' ' + h + ':' + m + ':' +s;
},
// 日期===>时间戳
timeToTimestamp(time){
var date = new Date(time);
var timestamp = date.getTime();//精确到毫秒
return timestamp
// var date = new Date('2014-04-23 18:55:49:123');
// 有三种方式获取
// var time1 = date.getTime();//精确到毫秒
// var time2 = date.valueOf();//精确到毫秒
// var time3 = Date.parse(date);//只能精确到秒毫秒用000替代
// console.log(time1);//1398250549123
// console.log(time2);//1398250549123
// console.log(time3);//1398250549000
},
// 随机数生成
randomStr(){
var strData = "";
//如果觉得12个数太少也可以多放点将i<4修改即可
for(var i=0;i<4;i++){
var num = random(0,9); //数字
var upper = String.fromCharCode(random(65,90)); //大写字母
var lower = String.fromCharCode(random(97,122)); //小写字母
strData = strData+num+upper+lower; //将所有结果放进strData中
}
var str = "";
for (var i = 0; i < 4; i++) {
str += strData[random(0,strData.length-1)]; //在strData里面随机抽取四个数
}
return str;
},
// 金额输入框验证
checkPrice(number,zong){
let reg = /^[0-9]*$/;//数字正则表达式
let newObj = {}
zong = parseInt(zong).toString()//取小数点左边的整数
if(!reg.test(number)){//不是数字时
newObj = {
len:zong.length,//动态设置长度
val:zong//动态设置值正整数的总金额
}
} else {//是数字时
newObj = {
len:zong.length,
val:number//动态设置当前输入的值
}
if(number*1 > zong*1){//输入的金额大于总金额
newObj.val = zong//赋值总金额
}
}
return newObj
},
// 提示方法
showToast: function(msg, icon,time) {
// 弹框图标none默认无图标、loading、success
var newIncon = 'none';
if (icon) {newIncon = icon;}
// 弹框显示时间默认2秒
var newTime = 2000
if (time) {newTime = time;}
return uni.showToast({
title: msg,
icon: newIncon,
duration:newTime
})
},
// 格式化时间
formatTime: function(mss) {
// let dangTime = Math.round(new Date()/1000)//获取当前时间戳
var hours = parseInt((mss % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = parseInt((mss % (1000 * 60 * 60)) / (1000 * 60));
var seconds = (mss % (1000 * 60)) / 1000;
hours = hours < 10 ? ('0' + hours) : hours;
minutes = minutes < 10 ? ('0' + minutes) : minutes;
seconds = seconds < 10 && seconds >= 1 ? ('0' + seconds) : seconds;
return hours + ' : ' + minutes + ' : ' + seconds;
},
// 富文本转换
escape2Html(str) {
var arrEntities = { 'lt': '<', 'gt': '>', 'nbsp': ' ', 'amp': '&', 'quot': '"' };
return str.replace(/&(lt|gt|nbsp|amp|quot|src);/ig, function (all, t) {
return arrEntities[t];
})
.replace('<section', '<div')
.replace(/\<img/g, '<img @tap="pre" style="max-width:100%!important;height:auto;" ')
.replace(/src=\"/g,'src="https://oss.hmzfyy.cn');
// 去除图片间隙 vertical-align:middle;
},
updaX(){//检测小程序版本以及更新小程序
// 获取小程序的运行环境、版本号、appId 注意:线上小程序版本号仅支持在正式版小程序中获取,开发版和体验版中无法获取。
const accountInfo = wx.getAccountInfoSync();//使用详情https://developers.weixin.qq.com/miniprogram/dev/api/open-api/account-info/wx.getAccountInfoSync.html
var version = accountInfo.miniProgram.version
console.log(version);
// 检测小程序的更新
const updateManager = wx.getUpdateManager()//以下使用详情https://developers.weixin.qq.com/miniprogram/dev/api/base/update/UpdateManager.html#%E7%A4%BA%E4%BE%8B%E4%BB%A3%E7%A0%81
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
})
updateManager.onUpdateReady(function (res) {
wx.showModal({
title: 'xxx植发客服代表提醒您',
content: '新版本已经准备就绪,是否重启应用',
success(res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function (res) {
// 新版本下载失败
})
},
// 判断是否授权,没授权,前往登录页面授权
judgeAuth(){
let auth = true;
if(uni.getStorageSync('phone_active')==0 || uni.getStorageSync('is_active')==0) {
uni.navigateTo({url:'/pages/login/login'});
auth = false
} else {
auth = true
}
return auth
},
// 复制内容
clickCopy(data){
uni.setClipboardData({
data: data,
success: function() {
uni.showToast({
title: '复制成功',
duration: 2000,
icon: 'none'
});
}
});
},
// 订单开启倒计时
dayTime(endTime,startTime=''){
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(date).getTime() - startTime)/1000);
// 总秒数
let second = totalSecond;
// 天数
let day = Math.floor(second / 3600 / 24);
let dayStr = day.toString();
if(dayStr.length == 1) dayStr = '0' + dayStr;
// 小时
let hr = Math.floor((second - day * 3600 * 24) / 3600);
let hrStr = hr.toString();
if(hrStr.length == 1) hrStr = '0' + hrStr;
// 分钟
let min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60);
let minStr = min.toString();
if(minStr.length == 1) minStr = '0' + minStr;
// 秒
let sec = second - day * 3600 * 24 - hr * 3600 - min * 60;
let secStr = sec.toString();
if(secStr.length == 1) secStr = '0' + secStr;
let newTime = '';
if(dayStr==0) {
newTime = hrStr +'时'+ minStr +'分'+ secStr +'秒';
} else {
newTime = dayStr +'天'+ hrStr +'时'+ minStr +'分'+ secStr +'秒';
}
return newTime;
},
isVedio(){//是否显示视频相关内容
uni.request({
url: `${uni.getStorageSync('hostapi')}index/base-config`,
method: 'get',
header: {
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: res => {
if(res.data.code==0){
res.data.data.v==0 ? uni.setStorageSync('isVedio',false) : uni.setStorageSync('isVedio',true);
let appletImg = 'https://oss.hmzfyy.cn' + res.data.data.logo;
uni.setStorageSync('appletImg',appletImg);
state.commit('updateAppletImgEv',appletImg);
}
}
})
},
// 判断当前环境
currentContext(){
// #ifdef APP-PLUS
if(uni.getSystemInfoSync().platform != "devtools"){//devtools开发版 值域为ios、android、mac3.1.10+、windows3.1.10+、linux3.1.10+
console.log = () =>{}
}
// #endif
// 微信小程序原生API性能优化
// #ifdef MP-WEIXIN
let hInfo = wx.getAccountInfoSync();
// console.log(hInfo.envVersion);//develop:开发版 trial体验版 release正式版
if(hInfo.miniProgram.envVersion == "develop" || hInfo.miniProgram.envVersion == "trial"){
// (开发版,体验版)-配置全局域名
uni.setStorageSync('hostapi','https://dxscrm.scdxtc.com/');
} else {
// 清除所有输出日志
console.log = () =>{};
// 正式版-配置全局域名
uni.setStorageSync('hostapi','https://dxscrm.scdxtc.com/');
// 开启埋点倒计时
// this.daoTime();//开启埋点倒计时
}
// #endif
},
timeToken:null,
// 开启一个半小时刷新token
refreshToken(){
console.log('开启了一个半小时刷新token');
clearInterval(this.timeToken);
// 调用登录事件
this.loginEv();
this.timeToken = setInterval(()=>{
console.log('进入了一个半小时刷新token');
// 调用登录事件
this.loginEv();
},600000*9)
},
// 登录事件
loginEv(){
uni.login({
provider: 'weixin',
success: (res)=> {
var params = {code:res.code}
uni.request({
url: `${uni.getStorageSync('hostapi')}user/login`,
method: 'post',
data: params,
success: res => {
if(res.data.data.token!=''){
uni.setStorageSync('token',res.data.data.token); // 缓存token
uni.setStorageSync('openid',res.data.data.openid)//缓存openid
uni.setStorageSync('expire',res.data.data.expire); // 缓存失效时间(时间戳格式)
uni.setStorageSync('phone_active',res.data.data.phone_active); // 是否绑定手机号
uni.setStorageSync('is_active',res.data.data.is_active)//是否第一次授权
uni.setStorageSync('invite_code',res.data.data.invite_code)//缓存用户邀请码
}
}
})
},
});
},
// 禁止小程序使用分享
disableShareEv(){
wx.hideShareMenu({
menus: ['shareAppMessage', 'shareTimeline']
})
}
}
export default {
tools
}

72
main.js Normal file
View File

@ -0,0 +1,72 @@
import Vue from 'vue'
import App from './App'
import store from './store'
Vue.prototype.$store = store
import statusNav from './components/status-nav.vue';//引入状态栏组件
Vue.component('status-nav',statusNav)//全局注册状态栏组件
import footTab from './components/foot-tab.vue';//引入底部tab组件
Vue.component('foot-tab',footTab)//全局注册底部tab组件
import backTop from './components/backTop.vue';//引入返回顶部组件
Vue.component('back-top',backTop)//全局注册返回顶部组件
import catePu from './components/cate-items/cate-pu.vue';//引入分类组件
Vue.component('cate-pu',catePu)//全局注册分类组件
import listPu from './components/list-pu.vue';//引入视频、图片列表组件
Vue.component('list-pu',listPu)//全局注册视频、图片列表组件
import pupo from './components/pupo.vue';//引入弹框组件
Vue.component('pu-po',pupo)//全局注册弹框组件
import nothingPage from './components/nothing-page.vue'//引入无内容组件
Vue.component('nothing-page',nothingPage)//全局注册无内容组件
import publicCustomer from './components/public-customer.vue'//引入客服组件
Vue.component('public-customer',publicCustomer)//全局注册客服组件
import authUserInfoMobileInfo from './components/auth/auth-userInfo-mobileInfo.vue'//引入授权用户信息,授权手机号组件
Vue.component('auth-userInfo-mobileInfo',authUserInfoMobileInfo)//全局注册授权用户信息,授权手机号组件
// 全局注册分享事件
import share from './jsFile/share.js'
Vue.mixin(share)
Vue.prototype.$hostApi = 'https://oss.hmzfyy.cn';
// 常用工具
import tools from '@/jsFile/tools.js'
Vue.prototype.$toolAll = tools;
// 响应数据
import requst from '@/jsFile/requst.js'
Vue.prototype.$requst = requst;
// 域名专治后台仔没有返回http/https的图片
Vue.prototype.$http = 'https://oss.hmzfyy.cn';
const {log} = console;
Vue.prototype.$log = log
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
store,
...App
})
app.$mount()

99
manifest.json Normal file
View File

@ -0,0 +1,99 @@
{
"name" : "Company",
"appid" : "__UNI__0EFED76",
"description" : "",
"versionName" : "1.0.0",
"versionCode" : "100",
"transformPx" : false,
"app-plus" : {
"usingComponents" : true,
"compilerVersion" : 3,
/* 5+App */
"modules" : {
"Payment" : {},
"Share" : {}
},
/* */
"distribute" : {
/* */
"android" : {
/* android */
"permissions" : [
"<uses-feature android:name=\"android.hardware.camera\"/>",
"<uses-feature android:name=\"android.hardware.camera.autofocus\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
"<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
]
},
"ios" : {},
/* ios */
"sdkConfigs" : {
"maps" : {},
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wxa02e44170bc722cd",
"UniversalLinks" : ""
}
},
"push" : {},
"geolocation" : {},
"share" : {
"weixin" : {
"appid" : "wxa02e44170bc722cd",
"UniversalLinks" : ""
}
},
"ad" : {}
}
}
},
/* SDK */
"quickapp" : {},
/* */
"mp-weixin" : {
/* */
"appid" : "wxa02e44170bc722cd",
"setting" : {
"urlCheck" : true,
"es6" : false
},
"usingComponents" : true,
"permission" : {
"scope.userLocation" : {
"desc" : "您的位置信息将用于小程序位置接口的效果展示"
}
}
},
"h5" : {
"devServer" : {
"port" : 8000,
"disableHostCheck" : true,
"proxy" : {
"/api" : {
"target" : "https://hengmei.scdxtc.cn", //
"changeOrigin" : true,
"secure" : false,
"pathRewrite" : {
"^/api" : ""
}
}
}
}
},
"mp-baidu" : {
"appid" : "24346353"
}
}

11
package.json Normal file
View File

@ -0,0 +1,11 @@
{
"id": "zhuge-swiper",
"name": "轮播视频和图片",
"version": "1.0.1",
"description": "自动轮播视频和图片组件。播放视频时停止轮播手动滑动swiper时视频停止播放",
"keywords": [
"vue",
"swiper",
"zhuge"
]
}

297
pages.json Normal file
View File

@ -0,0 +1,297 @@
{
"pages": [
{
"path" : "pages/tabbar/pagehome/pagehome",
"style" :{}
},{
"path" : "pages/login/login",
"style" :{
"navigationBarTextStyle":"black" //
}
},
{
"path" : "pages/tabbar/my/staffDuan",
"style" :{}
},
{
"path" : "pages/tabbar/shop/shop",
"style" :{}
},
{
"path" : "pages/tabbar/cate/cate",
"style" : {}
},
{
"path":"pages/login/xiey",
"style" :{}
}
],
"subPackages": [
{//A
"root": "pagesA",
"pages": [
{
"path" : "nodifyData/nodifyData",//
"style" : {}
}
,{
"path" : "makeAnPppointment/makeAnPppointment",//
"style" : {}
}
,{
"path" : "ppointmentEv/ppointmentEv",//
"style" :{}
}
,{
"path" : "suggestions/suggestions",//
"style" : {}
}
,{
"path" : "shopCart/shopCart",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "getReadyDan/getReadyDan",
"style" : {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "getReadyDan/getReadyDan-two",
"style" : {
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "member/member",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "integralManage/integralManage",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "peacockCoin/peacockCoin",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "signIn/signIn",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "myOrder/myOrder",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "myAddress/myAddress",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "activityTask/activityTask",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "coupon/coupon",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "pointsMall/pointsMall",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "my-diary/my-diary",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "my-diary-edit/my-diary-edit",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
},
{//B
"root": "pagesB",
"pages": [
{
"path" : "searchPage/searchPage",//
"style" :{}
}
,{
"path" : "mysharer/mysharer",//
"style" :{}
}
,{
"path" : "messagecenter/messagecenter",//
"style" : {}
}
,{
"path" : "myCollection/myCollection",//
"style" : {}
}
,{
"path" : "customerList/customerList",//
"style" : {}
}
,{
"path" : "userFootprint/userFootprint",//
"style" : {}
}
,{
"path" : "personalPoster/personalPoster",//
"style" : {}
},{
"path" : "sharingCenter/sharingCenter",//
"style" : {}
}
,{
"path" : "aboutUs/aboutUs",//
"style" : {}
}
,{
"path" : "articleDetail/articleDetail",//
"style" : {}
}
,{
"path" : "doctor/doctor",//
"style" : {}
}
,{
"path" : "doctorDetail/doctorDetail",//
"style" :{}
}
,{
"path" : "problemDetail/problemDetail",//
"style" : {}
},
{
"path":"video/playVideo",
"style":{}
},
{
"path":"customer/customer",
"style":{}
}
,{
"path" : "shopDetail/shopDetail",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "orderDetail/orderDetail",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "customerCheck/customerCheck",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "shopSearch/shopSearch",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
,{
"path" : "problemList/problemList",
"style" :
{
"navigationBarTitleText": "",
"enablePullDownRefresh": false
}
}
]
}
],
"preloadRule": {
"pages/tabbar/pagehome/pagehome": {
"network": "all",
"packages": ["pagesA"]
}
},
"globalStyle": {
"navigationBarTextStyle": "black",
"navigationBarTitleText": "Company",
"navigationBarBackgroundColor": "#FFFFFF",//
"backgroundColor": "#FFFFFF",//
"navigationStyle":"custom"//
}
}

219
pages/login/login.vue Normal file
View File

@ -0,0 +1,219 @@
<template>
<view>
<status-nav :titleVal="'登录'" :tabcolor="'rgba(244, 244, 244,1)'" :whereCome="1*1" :statusTitle="true" :backgroudColor="'rgba(244, 244, 244,1)'"></status-nav>
<!-- <view class='login-header'>
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
<view class="logo-name">Company</view>
</view>
<view class="login-box">
<button class='login-btn' :style="{background:publicColor}" type='primary' @click="bindGetUserInfo"></button>
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">用户服务协议</text></view>
</view>
<view v-if="isShowP" class="disjcac posAll">
<view class="bacf radius20 width100 tank-box">
<view class="tc tank-box-itemone">请授权绑定手机号</view>
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
<view class="pad-sx10 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
<view :style="{background:publicColor}" class="pad-sx10 radius10 tank-btn posir">
立即绑定
<button open-type="getPhoneNumber" @getphonenumber="getphonenumber" class="posia syxzo">立即绑定</button>
</view>
</view>
</view>
</view> -->
<view class='login-header'>
<image class="infoImg" :style="{boxShadow: '0px 0px 20px '+ publicColor}" mode="aspectFit" :src="userInfo.avatarUrl || imgSrc"></image>
<view class="logo-name">{{appletName}}</view>
</view>
<view class="login-box">
<view @tap="setMiniColor">
<button class='login-btn' open-type="getPhoneNumber" @getphonenumber="getphonenumber" :style="{background:publicColor}" type='primary'>手机号授权登录</button>
</view>
<view class="xie-box">登录代表您已同意<text @tap="goXie" class="xieCon">用户服务协议</text></view>
</view>
<view v-if="isShowP" class="disjcac posAll">
<view class="bacf radius20 width100 tank-box">
<view class="tc tank-box-itemone">微信授权</view>
<view class="fon28 colf pad-x30 pad-zy30 tc disjb">
<view class="pad-sx20 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不绑定</view>
<view :style="{background:publicColor}" class="pad-sx20 radius10 tank-btn posir">
立即授权
<button @click="bindGetUserInfo" class="posia syxzo">立即授权</button>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
userInfo: {},//
canIGetUserProfile: false,
imgSrc: '',//logo
appletName:'Company',//
isShowP:false,
};
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
}
},
onLoad(options) {
//
this.$toolAll.tools.currentContext();
this.setLogo();
this.$toolAll.tools.isVedio();
// let ya = this;
// // ,
// if (options && options.q) {
// let arr = decodeURIComponent(options.q).split('?')[1].split('&')
// let obj = {}
// arr.forEach(item => {
// let brr = item.split('=')
// obj[brr[0]] = brr[1]
// })
// // console.log(obj) //
// ya.invite_code = obj.invite_code
// }
if (uni.getUserProfile) {
this.canIGetUserProfile = true;
}
},
methods: {
// logo
setLogo(){
this.$requst.get('index/base-config').then(res=>{
this.imgSrc = this.$http + res.data.logo;
this.appletName = res.data.appletName;
})
},
refuse(){//
this.isShowP=false;
this.$toolAll.tools.showToast('登录成功','success')
uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
},
//
setMiniColor(){
this.$requst.get(`index/mini-program-setting`).then(res=>{
this.publicColor = res.data.mainColor;
uni.setStorageSync('publicColor', res.data.mainColor) //#3875F6 #2E8B57
})
},
getphonenumber(e){//
let ya = this;
wx.login({
success:(res)=>{
this.$requst.post('user/login',{code:res.code}).then(result => {
if(e.detail.errMsg=="getPhoneNumber:ok"){
this.$requst.post('user/bind-phone',{openid: result.data.openid,session_key:result.data.session_key, iv:e.detail.iv,encryptedData:e.detail.encryptedData}).then(res=>{
console.log('手机号信息:',res);
if(res.code==0){
this.$toolAll.tools.showToast('手机号绑定成功');
this.isShowP = true;
// uni.reLaunch({url:'/pages/tabbar/pagehome/pagehome'})
} else this.$toolAll.tools.showToast(res.msg);
},error=>{})
} else {
// console.log('')
}
}).catch(err=>{
console.log(err);
})
}
})
},
goXie(){
uni.navigateTo({
url:'/pages/login/xiey'
})
},
//
bindGetUserInfo(e) {
let ya = this;
//
uni.getUserProfile({
desc: '登录',
lang: 'zh_CN',
success: (res) => {
ya.userInfo = res.userInfo;
uni.login({
provider: 'weixin',
success: (res)=> {
if (res.code) {
ya.updateUserInfo(res.code);
} else {
uni.showToast({
title: '登录失败!',
duration: 2000
});
}
},
});
},
fail: (res) => {}
});
},
//
updateUserInfo(code) {
let ya = this;
uni.showToast({
title: '登录中...',
icon:'loading',
duration:10000
})
var params = {
code:code,
nickname: ya.userInfo.nickName,//
headimgurl: ya.userInfo.avatarUrl,//
country: ya.userInfo.country,//
province: ya.userInfo.province,//
city: ya.userInfo.city,//
gender: ya.userInfo.gender,//
language:ya.userInfo.language,//
is_active:1
}
this.$requst.post('user/login',params).then(res => {
if(res.data.token!=''){
uni.setStorageSync('params',params)
uni.setStorageSync('userId',res.data.account_id)
uni.setStorageSync('token',res.data.token)//token
uni.setStorageSync('openid',res.data.openid)//openid
uni.setStorageSync('expire',res.data.expire)//
uni.setStorageSync('phone_active',res.data.phone_active)//
uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('invite_code',res.data.invite_code)
uni.hideToast()
// if(res.data.phone_active!=1){
// this.isShowP = true;
// } else {
if(uni.getStorageSync('urlparams')) {
uni.reLaunch({ //
url:uni.getStorageSync('urlparams')
})
} else {
uni.reLaunch({
url:'/pages/tabbar/pagehome/pagehome'
})
}
// }
}
},error => {})
}
}
}
</script>
<style lang="less">
@tcolor:#333333;
@tcolorp:#3875F6;
.login-header {display: flex;justify-content: center;align-items: center;flex-direction: column;margin-top: 40%;}
.infoImg {width: 192rpx;height: 192rpx;border-radius: 100%;}
.logo-name {font-size: 30rpx;font-weight: bold;margin-top: 20rpx;color: @tcolor;}
.login-box {margin-top: 60rpx;text-align: center;}
.login-btn {width: 80%;margin-top: 50%;}
.xie-box{display: flex;justify-content: center;align-items: center;color: @tcolor;margin-top: 30rpx;}
.xieCon{color: @tcolorp;}
</style>

53
pages/login/xiey.vue Normal file
View File

@ -0,0 +1,53 @@
<template>
<view>
<status-nav :titleVal="'用户协议及隐私声明'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'px'}" class="mar20 line-h50 fon30">
<!-- <rich-text :nodes="content"></rich-text> -->
<view class="text2">本协议为您与本小程序管理者之间所订立的契约具有合同的法律效力请您仔细阅读</view>
<view>本协议内容生效变更本协议内容包括协议正文及所有本小程序已经发布的或将来可能发布的各类规则所有规则为本协议不可分割的组成部分与协议正文具有同等法律效力如您对协议有任何疑问应向本小程序咨询您在同意所有协议条款并完成注册程序才能成为本站的正式用户您登录即代表同意用户服务协议本协议即生效对双方产生约束力只要您使用本小程序平台服务则本协议即对您产生约束届时您不应以未阅读本协议的内容或者未获得本小程序对您问询的解答等理由主张本协议无效或要求撤销本协议您确认本协议条款是处理双方权利义务的契约始终有效法律另有强制性规定或双方另有特别约定的依其规定 您承诺接受并遵守本协议的约定如果您不同意本协议的约定您应立即停止注册程序或停止使用本小程序平台服务本小程序有权根据需要不定期地制订修改本协议及/或各类规则并在本小程序平台公示不再另行单独通知用户变更后的协议和规则一经在网站公布立即生效如您不同意相关变更应当立即停止使用本小程序平台服务您继续使用本小程序平台服务的即表明您接受修订后的协议和规则</view>
<view>注册资格用户须具有法定的相应权利能力和行为能力的自然人法人或其他组织能够独立承担法律责任您完成注册程序或其他本小程序平台同意的方式实际使用本平台服务时即视为您确认自己具备主体资格能够独立承担法律责任若因您不具备主体资格而导致的一切后果由您及您的监护人自行承担</view>
<view class="text2">
<view class="text2">2.1用户应自行诚信向本站提供注册资料用户同意其提供的注册资料真实准确完整合法有效用户注册资料如有变动的应及时更新其注册资料如果用户提供的注册资料不合法不真实不准确不详尽的用户需承担因此引起的相应责任及后果并且本小程序保留终止用户使用本平台各项服务的权利</view>
<view class="text2">2.2用户在本站进行浏览等活动时涉及用户真实姓名/名称通信地址联系电话电子邮箱等隐私信息的本站将予以严格保密除非得到用户的授权或法律另有规定本站不会向外界披露用户隐私信息为完成创建账号用户需提供以下信息用户的微信昵称性别姓名手机号等信息用户提供的上述信息将在用户使用本服务期间持续授权我们使用在用户注销账号时我们将停止使用并删除上述信息上述信息将存储于中华人民共和国境内如需跨境传输我们将会单独征得用户的授权同意</view>
</view>
<view>账户</view>
<view>
<view class="text2">3.1您注册成功后即成为本小程序平台的用户将持有本小程序平台唯一编号的账户信息</view>
<view class="text2">3.2您设置的姓名为真实姓名不得侵犯或涉嫌侵犯他人合法权益否则本小程序有权终止向您提供服务注销您的账户</view>
<view class="text2">3.3您应谨慎合理的保存使用您的会员名和密码应对通过您的会员名和密码实施的行为负责除非有法律规定或司法裁定且征得本小程序的同意否则会员名和密码不得以任何方式转让赠与或继承与账户相关的财产权益除外</view>
<view class="text2">3.4用户不得将在本站注册获得的账户借给他人使用否则用户应承担由此产生的全部责任并与实际使用人承担连带责任</view>
<view class="text2">3.5如果发现任何非法使用等可能危及您的账户安全的情形时您应当立即以有效方式通知本小程序要求暂停相关服务并向公安机关报案您理解本小程序对您的请求采取行动需要合理时间本小程序对在采取行动前已经产生的后果包括但不限于您的任何损失不承担任何责任</view>
</view>
<view>用户信息的合理使用</view>
<view>
<view class="text2">4.1您同意本小程序平台拥有通过短信电话微信消息提醒等形式向在本站注册用户发送信息等告知信息的权利</view>
<view class="text2">4.2您了解并同意本小程序有权应国家司法行政等主管部门的要求向其提供您在本小程序平台填写的注册信息和交易记录等必要信息如您涉嫌侵犯他人知识产权则本小程序亦有权在初步判断涉嫌侵权行为存在的情况下向权利人提供您必要的身份信息</view>
<view class="text2">4.3用户同意本小程序有权使用用户的注册信息用户名密码等信息登陆进入用户的注册账户进行证据保全包括但不限于公证见证等</view>
</view>
<view>免责条款</view>
<view class="text2">5.1 本平台仅提供信息对接发生一切纠纷问题皆与本平台无关请通过仲裁部门维护各自权益</view>
</view>
</view>
</template>
<script>
export default {
data(){
return {
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
}
},
onLoad() {
// this.$toolAll.tools.escape2Html(this.content)
}
}
</script>
<style>
</style>

630
pages/tabbar/cate/cate.vue Normal file
View File

@ -0,0 +1,630 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :statusBack="false" :titleVal="'分类'" :statusTitle="true"></status-nav>
<view class="disje mar-zy20" :style="{paddingTop: (statusHeight+10)+'px'}">
<template v-if="cateList.length!=0">
<view class="cate-box" :style="{paddingTop:statusHeight+'px'}" style="overflow: hidden;overflow-y: scroll;">
<view class="fon26">
<view class="mar-s20 flexs" :style="{color : ccurrent==indexc ? publicColor:''}"
:class="ccurrent==indexc?'bold cateActive':'catemo'"
v-for="(itemc,indexc) in cateList" :key="indexc"
@tap="chooseCate(indexc)">{{itemc.title}}</view>
</view>
</view>
<view :style="{width:cateW+'px'}" class="flexs" style="height: 10px;"></view>
<view v-show="isLoading" class="pad-x260" style="width: 74%;">
<!-- 热门推荐 -->
<template>
<!-- 自定义轮播 -->
<!-- <swiper-pu :bannerList="bannerList" :isplay="isAutoPlay" :newHeight="'154'" :newRadius="'10'" :newBottom="'10'"></swiper-pu> -->
<!-- 自定义二级分类 -->
<view class="mar-x20">
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" @choosecateEv="chooseTwo" :newcateList="cateListTwo"></cate-pu>
</view>
<!-- 列表 -->
<block v-if="!isHot">
<view v-if="dataList.length!=0">
<list-pu @chooseLike="chooseLike" @praise="praiseEv" @comfirmev="comfirmev" :nFon="'14'" :radiu="true" :nmarz="'6'" :nWidth="'90'" :nHeight="'90'" :list="dataList"></list-pu>
</view>
<view v-else style="padding-top: 150rpx;">
<list-pu @chooseLike="chooseLike" @praise="praiseEv" @comfirmev="comfirmev" :list="dataList"></list-pu>
</view>
</block>
<block v-else>
<view v-if="dataShopList.length!=0" style="margin-top: -20rpx;">
<view class="pad-sx20">
<view style="width: 48.6%;float: left;">
<view v-if="index1%2==0" v-for="(item1,index1) in dataShopList" :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 dataShopList" :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>
</view>
</view>
<view v-else class="disjcac fc" style="margin-top: 34%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<view class="fon24 col3">暂无内容</view>
</view>
</block>
</template>
<!-- 秃顶种植 -->
<!-- <template v-if="ccurrent!=0">
<view v-if="tuList.length!=0">
<cate-tu :isDetail="true" :list="tuList"></cate-tu>
</view>
<view v-else class="disjcac fc" style="margin-top: 60%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<view class="fon24 col3">暂无内容</view>
</view>
</template> -->
</view>
</template>
</view>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='1'></foot-tab>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import swiperPu from '@/components/swiper-pu.vue';
import cateTu from '@/components/cate-items/cate-tu.vue';
import {collectionEV,cancleCollectionEV,checkBanner} from '@/jsFile/publicAPI.js';
export default {
components:{
swiperPu,
cateTu
},
data() {
return {
ccurrent:0,
cateList:[],
cateListTwo:[//
],
dataList:[//
],
showTop:false,//
tuList:[],
newCurrent:0,
cateW:'',//
isLoading:false,
page:1,
size:10,
total:'',//
isZanw:true,
category_id:'',//ID
disease_id:'',//ID
bannerList:[],
zanArr:[],
dataShopList:[],
timeList:[],
isHot:false,
isAutoPlay:false,
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
if(this.ccurrent==0){
this.checkCate(this.category_id)//
} else {
this.otherEv(this.cateList[this.ccurrent].children[this.newCurrent].id)
}
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
this.isZanw = false
}
},
onUnload() {
this.isAutoPlay = false;
},
onHide() {
this.isAutoPlay = false;
},
onLoad(options) {
if(options.index==undefined) {
this.ccurrent = 0;
} else {
this.ccurrent = options.index*1;
}
// tools.js
this.$toolAll.tools.plantPoint(7);
this.checkSwi()
},
onShow() {
this.isAutoPlay = true;
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkBZ()//
if(this.ccurrent==0) {
if(this.category_id!='') this.checkCate(this.category_id)//
}
}
},
methods: {
checkSwi(){
checkBanner({position:'category-hot-banner'}).then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let isVideo = false
if(item.type!='img') isVideo = true
let banObj = {
imgSrc:this.$http + item.src,
url:item.url,
isVideo:isVideo,
poster:this.$http + item.src,
}
this.bannerList.push(banObj)
})
}
//
}
})
},
chooseLike(e){//
// console.log(this.dataList[e].is_collected);
if(this.dataList[e].is_collected==0){
this.dataList[e].is_collected = 1
this.dataList[e].collects++;
//
collectionEV({action:'collect',archive_id:this.dataList[e].id})
}
},
praiseEv(e){ //
// console.log(this.dataList[e].is_collected);
if(this.dataList[e].is_liked==0){
this.dataList[e].is_liked = 1;
this.dataList[e].likes++;
if(this.dataList[e].likes>1000) this.dataList[e].likes = '999+'
//
collectionEV({action:'like',archive_id:this.dataList[e].id})
}
},
comfirmev(e){//
this.dataList[e].is_collected = 0
this.$toolAll.tools.showToast('正在取消...','loading')
this.dataList[e].collects--;
//
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
},
checkBZ(){//
this.$requst.post('archives/disease').then(res=>{
// console.log('',res);
if(res.code==0 && res.data.length!=0){
this.cateList=[]
res.data.forEach(item=>{
let obj = {
id:item.id,
title:item.name,
pid:item.pid,
sort:item.sort,
children: item.children
}
this.cateList.push(obj)
})
let reObj = {
id:this.cateList[0].id,
title:'热门推荐',
pid:this.cateList[0].pid,
sort:this.cateList[0].sort
}
this.cateList.unshift(reObj)
if(this.ccurrent==0){
this.checkCate(this.category_id)//
} else {
this.chooseCate(this.ccurrent);
if(this.cateList[this.ccurrent].length) {
this.otherEv(this.cateList[this.ccurrent].children[0].id);//
}
}
if(this.cateList.length!=0){
setTimeout(()=>{
const query = wx.createSelectorQuery()
query.select('.cate-box').boundingClientRect((rect) => {
// console.log('',rect.width);
this.cateW = rect.width
}).exec()
},300)
}
setTimeout(()=>{this.isLoading = true},500)
}
})
},
checkCate(category_id){//
this.dataShopList = [];
// this.$toolAll.tools.showToast('...')
this.$requst.post('archives/hot',{category_id:category_id,page:this.page,size:this.size}).then(res=>{
// console.log('',res);
if(res.code==0){
if(this.category_id==''){
if(res.data.category.length!=0){
this.cateListTwo = []
res.data.category.forEach(item=>{
let cateObj = {
id:item.id,
model:item.model,
model_id:item.model_id,
sort:item.sort,
title:item.title
}
this.cateListTwo.push(cateObj)
})
this.cateListTwo.push({title:'热门商品'})
this.cateListTwo.push({title:'筛选'})
this.category_id = this.cateListTwo[0].id
}
}
//
if(this.page==1) {
this.dataList = [];
uni.pageScrollTo({
scrollTop:0,
duration:0
})
}
if(res.data.list.list.length!=0){
this.total = res.data.list.total
res.data.list.list.forEach(item=>{
let fabImg = '';
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
let tObj = {
category_id:item.category_id,//ID
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: fabImg || this.appletImg,//
name:item.published_by || 'Company',//
isVideo:item.video.includes(".mp4"),//
likes:item.likes,//
is_liked:item.is_liked//
}
this.dataList.push(tObj);
})
}
}
},error=>{})
},
checkData(disease_id){//
this.$requst.post('archives/disease-question',{disease_id:disease_id}).then(res=>{
// console.log('',res);
if(res.code==0){
this.tuList = []
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let arr = []
if(item.children.length!=0){
item.children.forEach(itemt=>{
let objt = {
category_id:itemt.category_id,
content:itemt.title,
id:itemt.id,
disease_id:itemt.disease_id,//ID 1
disease_second_id:itemt.disease_second_id,//ID 12
subtitle:itemt.subtitle//
}
arr.push(objt)
})
}
let obj = {
title:item.name,
src:'',
list:arr
// {content:''},
// {content:''},
// {content:''},
// {content:''},
// ]
}
this.tuList.push(obj)
})
}
}
},error=>{})
},
chooseCate(index){//
this.page = 1;
this.ccurrent = index;
this.newCurrent = 0;
if(this.ccurrent!=0){
// this.checkData(this.cateList[index].id);
if(this.cateList[index].children.length){
this.cateListTwo = []
this.cateList[index].children.forEach(item=>{
let cateObj = {
id:item.id,
title:item.name
}
this.cateListTwo.push(cateObj)
})
this.cateListTwo.push({title:'筛选'})
this.category_id = this.cateListTwo[0].id
this.otherEv(this.cateList[index].children[0].id);
} else {
this.cateListTwo = [];
this.dataList = [];
}
} else {
this.category_id = '';
this.checkCate('');
}
// console.log(':',index);
},
otherEv(id){
this.$requst.post('archives/disease-second-question',{disease_second_id:id,page:this.page,size:this.size}).then(res=>{
//
if(this.page==1) {
this.dataList = [];
uni.pageScrollTo({
scrollTop:0,
duration:0
})
}
if(res.data.list.list.length!=0){
this.total = res.data.list.total
res.data.list.list.forEach(item=>{
let fabImg = '';
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
let tObj = {
category_id:item.category_id,//ID
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: fabImg || this.appletImg,//
name:item.published_by || 'Company',//
isVideo:item.video.includes(".mp4"),//
likes:item.likes,//
is_liked:item.is_liked//
}
this.dataList.push(tObj);
})
} else {
this.dataList = [];
}
})
},
chooseTwo(index){//
this.newCurrent = index
this.isZanw = true;
this.isHot = false;
this.page = 1
this.category_id = this.cateListTwo[index].id
// console.log('',this.cateListTwo[index].title);
if(this.cateListTwo[index].title=='筛选'){
uni.navigateTo({
url:'/pagesB/searchPage/searchPage'
})
} else if(this.cateListTwo[index].title=='热门商品'){
this.isHot = true;
this.checkSotList()
} else {
if(this.ccurrent==0){
this.checkCate(this.cateListTwo[index].id)
} else {
this.otherEv(this.cateListTwo[index].id);
}
}
},
checkSotList(){
this.dataList = [];
let params = {
page:1,
size:2000,
is_hot:1
}
uni.request({
url:`${getApp().globalData.hostApi}spu/list`,
data:params,
method:'post',
header:{
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: (res) => {
if(res.data.code==0){
clearInterval(this.timer);
// if(this.page==1) {
this.zanArr = [];
this.dataShopList = [];
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;
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)
group_cover.push(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,//
reponseTime:res.header.Date,//
activity_end_at:item.activity_end_at,//
activity_group_cover:group_cover,//
activity_group_num:item.activity_group_num,//
}
this.zanArr.push(obj)
})
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.dataShopList = this.zanArr;
},1000)
} else {
this.dataShopList = this.zanArr;
}
}
}
}
})
},
goPage(id,index){//
uni.navigateTo({
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataShopList[index].isIntegral}`
})
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,601 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :backgroudColor="publicColor" :tabcolor="publicColor" :statusTitle="true" :statusBack="false"></status-nav>
<image src="/static/public/staff-head.png" class="blue-img"></image>
<view class="mar-zy32 posir pad-x260" :style="{paddingTop:statusHNH+'px'}">
<view class="radius20 posir gao">
<view class="posia" :style="{top:`-${gaoh*0.4}px`,height:gaoh+'px'}"></view>
<view class="disjbac">
<view class="disac colf">
<!-- 头像 -->
<image @tap="openXiao" class="mar-sx30" :src="userInfo.headimgurl || ''" mode="aspectFill"></image>
<view class="mar-z30">
<!-- 昵称 -->
<view class="disac">
<view class="fon36 bold clips1" style="max-width: 260rpx;">{{userInfo.nickname || ''}}</view>
<view class="gao-name">{{userInfo.level.name}}</view>
</view>
<view class="disac mar-s10" v-if="userPhone!==''">
<image src="/static/public/phone-02.png" class="gao-phone" mode=""></image>
<!-- 手机号 -->
<view class="fon24 mar-z10">{{userPhone}}</view>
</view>
</view>
</view>
<view class="mar-y25 disac">
<!-- 二维码 -->
<image @tap="tuneUpqr" src="/static/public/staff-qro.png" class="gao-m" mode=""></image>
<!-- 前进键 -->
<view @tap="goNodifyData" class="disac gao-next-box">
<!-- <image class="" src="/static/public/next-white.png" mode="aspectFill"></image> -->
<image class="" src="/static/public/set-icon.png" mode="aspectFill"></image>
</view>
</view>
</view>
<view class="disjbac posir mar-s40 fon24 pad-zy50" style="z-index: 1;color: #F8CE59;">
<view>
<view class="disac"><span class="bold mar-y20">VIP</span>{{userInfo.level.name}}</view>
</view>
<navigator url="/pagesA/member/member" hover-class="none">
<view class="disac">
<view>更多权益</view>
<image src="/static/public/next-yellow.png" class="white-next" mode=""></image>
</view>
</navigator>
</view>
</view>
<view class="disja posir" style="z-index: 1;margin-top: 75rpx;">
<view @tap="chooseone(indext)" class="disac fc flexs width25" v-for="(itemt,indext) in tongList" :key="indext">
<view class="fon28 bold mar-sx20 clips1">{{itemt.num}}<text v-if="indext==2"></text><text v-if="indext==3"></text></view>
<view class="fon28 mar-x25">{{itemt.title}}</view>
</view>
</view>
<!-- 员工功能 v-if="userInfo.is_staff && yuanList.length!=0" -->
<view v-if="userInfo.is_staff==1" class="bacf radius20 mar-s20 pad20">
<view class="mar-x30 fon28 bold col3">员工功能</view>
<view class="disja yuan-box">
<view @tap="chooseYitem(indexy)" v-for="(itemy,indexy) in yuanList" :key="indexy">
<view class="disac fc">
<image :src="itemy.src" mode="aspectFill"></image>
<view class="fon28 mar-s20 mar-x10">{{itemy.title}}</view>
</view>
<block v-if="indexy<yuanList.length-1">
<view class="xian-right"></view>
</block>
</view>
</view>
</view>
<!-- 我的订单 -->
<view class="bacf radius20 mar-s20 pad20">
<view class="mar-x30 fon28 col3 disjbac">
<view>我的订单</view>
<navigator url="/pagesA/myOrder/myOrder?index=0" hover-class="none">
<view class="disac">
<view class="fon24 col9">全部</view>
<image src="/static/public/nextM.png" class="white-next" mode=""></image>
</view>
</navigator>
</view>
<view class="disja fon28 col3">
<view @tap="chooseOrderStatus(indexo)" v-for="(itemo,indexo) in myOrderList" :key="indexo">
<view class="disac fc posir">
<image :src="itemo.src" class="icon-img" mode="aspectFill"></image>
<view class="mar-s20 mar-x10">{{itemo.title}}</view>
<view class="posia red-num" style="right: 0;top: 0;" v-if="itemo.num!=0">{{itemo.num}}</view>
</view>
</view>
</view>
</view>
<!-- 广告 -->
<!-- <image @tap="goPage" class="width100 radius20 mar-sx20" :src="guangImg" style="height: 160rpx;" mode="aspectFill"></image> -->
<!-- 功能列表① -->
<view class="bacf radius20 mar-s20">
<view class="disac fon28 col3 fw">
<view @tap="goPageNew(indexm)" v-for="(itemm,indexm) in moneyList" :key="indexm" class="mar-s20 mar-x20 width25">
<view class="disac fc">
<image :src="itemm.src" class="icon-img" mode="aspectFill"></image>
<view class="mar-s20 mar-x10">{{itemm.title}}</view>
</view>
</view>
</view>
</view>
<!-- 功能列表② -->
<view class="bacf radius20 mar-s20">
<view class="disac fon28 col3 fw">
<view @tap="goPageTwo(indexf)" v-for="(itemf,indexf) in toolsList" :key="indexf" class="mar-s20 mar-x20 width25">
<view class="disac fc posir">
<image :src="itemf.src" class="icon-img" mode="aspectFill"></image>
<view class="mar-s20 mar-x10">{{itemf.title}}</view>
<view v-if="itemf.title=='消息通知' && itemf.num!=0" class="posia red-num">{{itemf.num}}</view>
</view>
</view>
</view>
</view>
</view>
<!-- 我的二维码弹框 -->
<view v-if="isQrcode" class="posAll disjcac">
<view>
<view class="bacf radius20" style="margin: 0 130rpx;">
<view class="fon28 col3 tc pad-s40">我的二维码</view>
<image :src="myqr" class="person-m" mode="aspectFill"></image>
</view>
<view class="disjcac">
<image @tap="closeqr" class="mar-s50 close-m" src="/static/public/qrcodec.png" mode="aspectFill"></image>
</view>
</view>
</view>
<!-- 专属客服 -->
<view v-if="zCustomer" class="posAll disjcac">
<view style="width: 80%;">
<view class="bacf radius20 pad-sx40" style="">
<view class="fon32 bold col3 tc pad-x40" v-if="customerInfo.service_name!=''"></view>
<view class="fon28 col3 disjb mar20" v-if="customerInfo.service_name!=''">{{customerInfo.service_name}}</view>
<view class="fon28 col3 disjb mar20" v-if="customerInfo.service_phone!=''">{{customerInfo.service_phone}}<span @tap="countCustomer(customerInfo.service_phone)" class="pcol">联系客服</span></view>
<view class="fon28 col3 disjb mar20" v-if="customerInfo.service_wechat!=''">{{customerInfo.service_wechat}}<span @tap="copyWechat" class="pcol">复制</span></view>
<view style="display: flex;align-items: center;flex-direction: column;width: 100%;">
<image v-if="customerImg!=''" :src="customerImg" class="person-m" style="margin-bottom: 40rpx;" mode="aspectFill"></image>
<view class="fon28 colf tc radius10" @tap="saveImg" style="width: 200rpx; padding: 16rpx;background-color: #38CE51;margin: 0 auto;">保存</view>
</view>
<view class="fon28 col9 tc pad-s40" v-if="customerInfo.service_phone==''"></view>
</view>
<view class="disjcac">
<image @tap="closeCustomer" class="mar-s50 close-m" src="/static/public/qrcodec.png" mode="aspectFill"></image>
</view>
</view>
</view>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='4'></foot-tab>
<!-- 签到弹框 -->
<view v-if="isQian" class="sigin-box">
<view>{{contentVal}}</view>
</view>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import {base64ToPath} from '@/jsFile/base64-src.js';
import {checkBanner,themeEv} from '@/jsFile/publicAPI.js';
export default {
data() {
return {
statusHNH:uni.getSystemInfoSync().statusBarHeight + 54,
tongList:[
{num:'0',title:'我的积分'},
// {num:'0',title:''},
{num:'0',title:'连续签到'},
{num:'0',title:'我的分享人'}
],
yuanList:[], //'customer-list','footmarks','scan'
zanCyuanList:[
{src:'/static/public/keh.png',title:'客户列表',rule:'customer-list'},
{src:'/static/public/zu.png',title:'用户足迹',rule:'footmarks'},
{src:'/static/public/scan.png',title:'扫码签到',rule:'scan'},
{src:'/static/public/customer-check.png',title:'客服查询',rule:'customer-list'},
{src:'/static/public/scan.png',title:'核销扫码',rule:'check-scan'},
],
myOrderList:[//
{src:'/static/public/dai-fu60.png',title:'待付款',num:0},
{src:'/static/public/dai-fa60.png',title:'待发货',num:0},
{src:'/static/public/dai-shou60.png',title:'待收货',num:0},
{src:'/static/public/wan-60.png',title:'已完成',num:0},
],
moneyList:[
{src:'/static/public/integral60.png',title:'积分商城'},
{src:'/static/public/address60.png',title:'地址管理'},
{src:'/static/public/day60.png',title:'日程提醒'},
{src:'/static/public/ren60.png',title:'活动任务'},
{src:'/static/public/quan60.png',title:'优惠券'},
// {src:'/static/public/kong60.png',title:''},
{src:'/static/public/scor60.png',title:'积分管理'},
{src:'/static/public/signIn.png',title:'积分签到'},
],
toolsList:[
{src:'/static/public/staff-yue60.png',title:'自助预约',num:''},
{src:'/static/public/staff-hai60.png',title:'个人海报',num:''},
{src:'/static/public/staff-collection60.png',title:'收藏',num:''},
{src:'/static/public/staff-share.png',title:'分享中心',num:''},
{src:'/static/public/staff-msg60.png',title:'消息通知',num:''},
{src:'/static/public/diary.png',title:'我的日记',num:''},
{src:'/static/public/staff-about60.png',title:'关于我们',num:''},
{src:'/static/public/staff-tou60.png',title:'投诉与建议',num:''},
],
isQrcode:false,//
userInfo:{},//
gaoh:uni.getStorageSync('gao'),
myqr:'/static/public/qrcode.png',
is_worker:'',//0 1
is_doctor:'',//01
is_servicer:'',//01
is_staff:'',//01
isQian:false,
bannerList:[],
guangImg:'',
guanggao:'',
userToken:'',
contentVal:'',//
userPhone:'',
timer:null,
nonce_str:'',
zCustomer:false,
customerImg:'',
customerInfo:'',
times:0,
openSettingBtnHidden: true,//
}
},
onUnload: function() {
//
let pages = getCurrentPages();
// console.log('pages:',pages);
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
}
},
onShow() {
uni.removeStorageSync('uinfo')//
uni.removeStorageSync('shareAll')//
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkInfo();
}
},
onUnload() {
//
this.closeqr();
},
onLoad(options) {
uni.setStorageSync('channel',options.channel);
if(uni.getStorageSync('gao')==''){
const query = wx.createSelectorQuery()
query.select('.gao').boundingClientRect((rect) => {
uni.setStorageSync('gao',rect.height)
this.gaoh = rect.height
}).exec()
}
this.checkSwi()
},
methods: {
countCustomer(phone){//
const res = uni.getSystemInfoSync();
if(res.platform=='ios'){
uni.makePhoneCall({
phoneNumber:phone,
success: () => {},
fail: () => {}
})
} else {
uni.showActionSheet({
itemList:[phone,'呼叫'],
itemColor:'#3875F6',
success: (res) => {
if(res.tapIndex==1){
uni.makePhoneCall({
phoneNumber:phone
})
}
}
})
}
},
copyWechat(){//
if(this.times==0){
this.times++;
this.$toolAll.tools.clickCopy(this.customerInfo.service_wechat);
this.$toolAll.tools.showToast('复制成功');
setTimeout(()=>{
this.times = 0;
},2000)
}
},
saveImg(e){//
//
uni.getSetting({
success:(res)=> {
if (!res.authSetting['scope.writePhotosAlbum']) {
uni.authorize({
scope: 'scope.writePhotosAlbum',
success:()=> {
//
this.saveImgToLocal();
},
fail:()=> {//
this.openSettingBtnHidden=false
}
})
} else {//
this.saveImgToLocal();
}
}
})
},
saveImgToLocal(){//
this.$toolAll.tools.showToast('正在保存','loading');
uni.downloadFile({
url: this.customerImg,//
success: (res) =>{
if (res.statusCode === 200){
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: ()=> {
this.$toolAll.tools.showToast('保存成功');
},
fail: ()=> {
this.$toolAll.tools.showToast('保存失败');
}
});
}
}
})
},
tuneUpqr(){//
this.isQrcode = true;
clearInterval(this.timer);
this.myqr = '';
this.nonce_str='';
this.checkGM();
this.timer = setInterval(()=>{
if(this.nonce_str!=''){
this.$requst.post('user/check-scan',{nonce_str:this.nonce_str}).then(res=>{
if(res.code==0){
if(res.data.result==1){
this.$toolAll.tools.showToast('已签到');
this.isQrcode = false;
clearInterval(this.timer);
}
}
})
}
},3000)
setTimeout(()=>{
this.isQrcode = false;
clearInterval(this.timer);
},60000)
},
//
closeqr(){
this.isQrcode = false;
clearInterval(this.timer);
},
chooseone(index){
if(index==1){uni.navigateTo({url:'/pagesA/signIn/signIn'})}
if(index==2){uni.navigateTo({url:'/pagesB/mysharer/mysharer'})}
},
goPageNew(index){
if(index==0){uni.navigateTo({url:'/pagesA/pointsMall/pointsMall'})}
if(index==1){uni.navigateTo({url:'/pagesA/myAddress/myAddress'})}
if(index==2){uni.navigateTo({url:'/pagesB/messagecenter/messagecenter?index=true&comeNum=0'})}
if(index==3){uni.navigateTo({url:'/pagesA/activityTask/activityTask'})}
if(index==4){uni.navigateTo({url:'/pagesA/coupon/coupon'})}
// if(index==5){uni.navigateTo({url:'/pagesA/peacockCoin/peacockCoin'})}
if(index==5){uni.navigateTo({url:'/pagesA/integralManage/integralManage'})}
if(index==6){uni.navigateTo({url:'/pagesA/signIn/signIn'})}
},
goPageTwo(index){//
let newUrl = ''
if(this.toolsList[index].title=='自助预约') newUrl = '/pagesA/makeAnPppointment/makeAnPppointment'
if(this.toolsList[index].title=='个人海报') newUrl = '/pagesB/personalPoster/personalPoster'
if(this.toolsList[index].title=='收藏') newUrl = '/pagesB/myCollection/myCollection'
if(this.toolsList[index].title=='分享中心') newUrl = '/pagesB/sharingCenter/sharingCenter'
if(this.toolsList[index].title=='消息通知') newUrl = '/pagesB/messagecenter/messagecenter?comeNum=0'
if(this.toolsList[index].title=='我的日记') newUrl = '/pagesA/my-diary/my-diary'
if(this.toolsList[index].title=='关于我们') newUrl = '/pagesB/aboutUs/aboutUs'
if(this.toolsList[index].title=='投诉与建议') newUrl = '/pagesA/suggestions/suggestions'
if(this.toolsList[index].title=='专属客服'){
this.$requst.post('user/my-service').then(res=>{
if(res.code==0){
this.customerInfo = res.data;
if(this.customerInfo.service_qr!=''){
this.customerImg = this.$http + this.customerInfo.service_qr;
}
this.zCustomer = true;
}
})
} else {
uni.navigateTo({
url:newUrl
})
}
},
closeCustomer(){
this.zCustomer = false;
},
chooseOrderStatus(index){
let statusIndex = ''
if(index==0) statusIndex = 1;
if(index==1) statusIndex = 2;
if(index==2) statusIndex = 4;
if(index==3) statusIndex = 5;
uni.navigateTo({
url:'/pagesA/myOrder/myOrder?index='+statusIndex
})
},
goPage(){
uni.navigateTo({
url:this.guanggao
})
},
checkSwi(){
checkBanner({position:'personal-center-banner'}).then(res=>{
// console.log('res',res);
if(res.code==0){
if(res.data.length!=0){
this.guangImg = this.$http + res.data[0].src
this.guanggao = res.data[0].url
// res.data.forEach(item=>{
// let isVideo = false
// if(item.type!='img') isVideo = true
// let banObj = {
// imgSrc:this.$http + item.src,
// url:item.url,
// isVideo:isVideo,
// poster:this.$http + item.src,
// }
// this.bannerList.push(banObj)
// })
}
}
})
},
checkGM(){//
uni.showToast({
title:'正在生成二维码',
icon:'none',
duration:100000
})
this.$requst.post('user/personal-qr').then(res=>{
// console.log('',res);
if(res.code==0){
this.nonce_str = res.data.nonce_str;
base64ToPath(res.data.qr).then(path => {
this.myqr = path
uni.hideToast();
uni.setStorageSync('imgSrc',path)
}).catch(error => {})
}
},error=>{})
},
checkInfo(){
this.$requst.post('user/info').then(res=>{
// console.log('',res);
if(res.code==0 && res.data.length!=0) {
this.userInfo = res.data;
uni.setStorageSync('userId',res.data.id);
uni.setStorageSync('phone',this.userInfo.mobile);
this.userPhone = this.$toolAll.tools.hideMPhone(this.userInfo.mobile)
this.tongList[0].num = res.data.score;//
// this.tongList[1].num = res.data.coin;//
this.tongList[1].num = res.data.continuity_sign;//
this.tongList[2].num = res.data.share_users.total;//
this.toolsList[4].num = res.data.unread_messages;//
this.toolsList[5].num = res.data.unread_messages;//
this.myOrderList[0].num = res.data.order_count.waiting;//
this.myOrderList[1].num = res.data.order_count.paid;//
this.myOrderList[2].num = res.data.order_count.shipped;//
this.is_worker = res.data.is_worker;//0 1
this.is_doctor = res.data.is_doctor;//01
this.is_servicer = res.data.is_servicer;//01
this.is_staff = res.data.is_staff;//01
if(res.data.customer_service!=0 && this.toolsList.length==8){
this.toolsList.unshift({src:'/static/public/customer-check.png',title:'专属客服',num:''})
}
uni.setStorageSync('shareAll',res.data)
if(res.data.rules.length!=0){
//
let isFen = res.data.rules.indexOf('customer-allot');
if(isFen!=-1){
uni.setStorageSync('isFen',true);
} else {
uni.setStorageSync('isFen',false);
}
let result = this.zanCyuanList.filter(item => res.data.rules.some(itemt => itemt===item.rule))
this.yuanList = result
uni.setStorageSync('rules',res.data.rules)
} else this.yuanList = []
}
},error=>{})
},
chooseYitem(index){//
// console.log('',this.yuanList[index].title);
if(this.yuanList[index].title=='客户列表') {
uni.navigateTo({
url:'/pagesB/customerList/customerList'
})
}
if(this.yuanList[index].title=='用户足迹') {
uni.navigateTo({
url:'/pagesB/userFootprint/userFootprint'
})
}
if(this.yuanList[index].title=='扫码签到') {
wx.scanCode({ //
complete: (res) => {}, //
fail: (res) => {}, //
onlyFromCamera: false, //,
scanType: ['qrCode'], // scanType :
success: (rt) => { //
if(rt.result.slice(0,1)=='{'){
let uc = JSON.parse(rt.result).user_coding;
let ns = JSON.parse(rt.result).nonce_str;//
console.log(rt);
this.$requst.post('user/sign-in',{user_coding:uc,nonce_str:ns}).then(res=>{
// console.log('',res);
if(res.code==0){
this.isQian = true;
this.contentVal = "签到成功";
setTimeout(()=>{
this.isQian = false
},2000)
}
},error=>{})
} else this.$toolAll.tools.showToast('请出示正确的码');
}
})
}
if(this.yuanList[index].title=='核销扫码') {
wx.scanCode({ //
complete: (res) => {}, //
fail: (res) => {}, //
onlyFromCamera: false, //,
scanType: ['qrCode'], // scanType :
success: (rt) => { //
let narr = rt.result.split('H');
if(narr[1]=='true'){//
this.$requst.post('staff/coupon/write-off-experience-coupon',{coupon_id:narr[0],secret:narr[2],account_id:narr[3]}).then(res=>{
this.isQian = true
if(res.code==0){
this.contentVal = "核销成功";
} else {
this.contentVal = res.msg;
}
setTimeout(()=>{
this.isQian = false
},2000)
},error=>{})
} else {//
this.$requst.post('order/check',{order_coding:narr[0],id:narr[1],check_user:this.userInfo.id}).then(res=>{
this.isQian = true
if(res.code==0){
this.contentVal = "核销成功";
} else {
this.contentVal = res.msg;
}
setTimeout(()=>{
this.isQian = false
},2000)
},error=>{})
}
}
})
}
if( this.yuanList[index].title=='客服查询') {
uni.navigateTo({
url:'/pagesB/customerCheck/customerCheck'
})
}
},
goNodifyData(){//
uni.setStorageSync('uinfo',this.userInfo)
uni.navigateTo({
url:'/pagesA/nodifyData/nodifyData'
})
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,546 @@
<template>
<view>
<!-- 状态栏 -->
<view class="status-box statusHNH">
<view :style="{height:statusBarHeight+'px',background:publicColor}"></view>
<view class="status-nav" :style="{background:publicColor}">
<!-- 标题 -->
<view class="tab-title tcenter" style="color: #FFFFFF;">首页<text v-if="!isNet" class="mar-z20">(...)</text></view>
</view>
</view>
<template v-if="isNet">
<status-nav :titleVal="'首页'" :backgroudColor="publicColor" :tabcolor="'#FFFFFF'" :statusBack="false" :statusTitle="true" style="opacity: 0;"></status-nav>
<!-- 输入框 -->
<view class="input-box posiszy" :style="{top: statusHeight+'px',background:publicColor}" style="height: 60px;display: flex;align-items: center;">
<view class="disac width100">
<image class="searchImg flexs" src="/static/public/search.png" mode="aspectFill"></image>
<!-- 输入框 -->
<input @confirm="searchEv" class="width100 fon34" type="text" v-model="searchVal" placeholder="请输入问题/病种/医生姓名"/>
<!-- 竖线 -->
<view class="linev"></view>
<!-- 搜索 -->
<view @tap="searchEv" class="searchT flexs fon34" :style="{color:publicColor}">搜索</view>
</view>
</view>
<view class="pad-x180">
<!-- 自定义轮播 -->
<view :style="{marginTop: (statusHeight+60)+'px'}">
<swiper-pu :bannerList="bannerList" :isplay="isAutoPlay"></swiper-pu>
</view>
<!-- 宫格 -->
<view v-if="gonggList.length>1" class="mar-zy30 bacf radius10 pad-s25 mar-s10 disac fw">
<view class="disac fc gongg-box mar-x25" style="width: 25%;" @tap="chooseGon(indexgg)" v-for="(itemgg,indexgg) in gonggList" :key="indexgg">
<view class="img-box">
<image :src="itemgg.src" mode="aspectFill"></image>
</view>
<view class="fon24">{{itemgg.title}}</view>
</view>
</view>
<!-- 发问 -->
<!-- <view class="mar-zy30 mar-sx20 disjb">
<image class="flexs mar-y20 radius30 fawen-img" @tap="tapChoose(0)" :src="gaoone.imgSrc" mode="aspectFill"></image>
<view class="disjb fc width100">
<image class="radius30 width100 fawen-itemImg" @tap="tapChoose(1)" :src="gaotwo.imgSrc" mode=""></image>
<image class="radius30 width100 fawen-itemImg" @tap="tapChoose(2)" :src="gaothree.imgSrc" mode=""></image>
</view>
</view> -->
<!-- 热门搜索 -->
<view v-if="isLoading" class="mar-zy30 mar-s50">
<view class="col2c fon36 bold mar-x36">热门搜索</view>
<view class="bacf fon24 disac fw radius20 pad-zy20 pad-s20">
<view @tap="chooseReEv(indexf)" v-for="(itemf,indexf) in fwList" :key="indexf" class="disac radius10 mar-x20 reitem-box">
<image src="/static/public/hot.png" mode="aspectFill"></image>
<view class="">{{itemf.title}}</view>
</view>
</view>
</view>
<!-- 恒美小课堂 -->
<view v-if="isLoading" class="mar-zy30 mar-s40">
<!-- <view class="col2c fon36 bold">恒美小课堂</view> -->
<!-- 自定义二级分类 -->
<view class="mar-s50 mar-x30">
<cate-pu :activeb="publicColor" :newcateList="ktList" :isMinW="true" :newCurrent="newCurrent*1" @choosecateEv="choosecateEv" :newbmo="'#E0E0E0'"></cate-pu>
</view>
<!-- 列表 -->
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" @praise="praiseEv" :list="dataList"></list-pu>
</view>
</view>
</template>
<template v-else>
<view class="disjcac fc" style="height: 100vh;">
<view class="fon24 col3">{{wuNet}}<text @tap="refresh" class="mar-z20 pcol">刷新</text></view>
</view>
</template>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList"></foot-tab>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 底部客服 -->
<!-- <public-customer></public-customer> -->
<!-- 弹框优惠券 -->
<view class="home-quan-box" v-if="isQuan">
<image @tap="recerveEv" :src="quanImg" mode="aspectFill"></image>
<image @tap="closeEv" src="/static/public/closequan.png" mode=""></image>
</view>
</view>
</template>
<script>
import swiperPu from '@/components/swiper-pu.vue';
import {collectionEV,cancleCollectionEV,checkBanner} from '@/jsFile/publicAPI.js';
export default {
components:{
swiperPu,
},
data() {
return {
statusBarHeight:uni.getSystemInfoSync().statusBarHeight,
searchVal:'',//
//
gonggList:[],
//
fwList:[],
kcurrent:0,//
//
ktList:[],
//
dataList:[],
showTop:false,
newCurrent:0,
page:1,
size:10,
total:'',//
isZanw:true,
course_id:0,
isLoading:false,
isShowT:true,
gaoone:{},
gaotwo:{},
gaothree:{},
isNet:true,
wuNet:'当前无网络连接',
refTime:'',
reNum:0,
bannerList:[],//
isAutoPlay:false,
isNewRenderDone:false ,//
isQuan:uni.getStorageSync('isQuan'),
quanImg:uni.getStorageSync('quanImg'),
pagePath:''
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
this.checkKT()//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
this.isZanw = false
}
},
onHide() {
this.isAutoPlay = false;
},
onUnload() {
this.isAutoPlay = false;
},
onShareAppMessage(res) {
// tools.js
this.$toolAll.tools.plantPoint(6);
return {
title: '', // (slogan)
path: `/pages/tabbar/pagehome/pagehome?invite_code=${uni.getStorageSync('invite_code')}` // 默认是当前页面,必须是以‘/开头的完整路径
}
},
onShow() {
//
this.checkNet();
// tools.js
this.$toolAll.tools.plantPoint(6);
this.checkKT();//
this.isAutoPlay = true;
//
getApp().globalData.outside = false;
},
onLoad(options) {
//
let pages = getCurrentPages(); //
let currentPage = pages[pages.length - 1]; //
this.pagePath = currentPage.$page.fullPath;
if(options.q!=undefined){
// unescape("http%3A//www.baidu.com%3Fname%3Dzhang@xiao@jie%26order%3D1")
// decodeURIComponent("http%3A%2F%2Fwww.baidu.com%3Fname%3Dzhang%40xiao%40jie%26order%3D1")
let str = unescape(options.q);
// console.log(str);
let len1 = str.indexOf('invite_code=');
let len2 = str.indexOf('channel=');
let len3 = str.indexOf('source_code=');
let newInvite = '';
let newChanel = '';
let newsource_code = '';
if(len1!=-1) newInvite = str.slice((len1+12),(len1+12+32));
if(len2!=-1) newChanel = str.slice((len2+8),(len2+8+8));
if(len3!=-1) newsource_code = str.slice((len3+12),(len3+12+32));
uni.login({
provider: 'weixin',
success: (res)=> {
var params = {
code:res.code,
invite_code:newInvite,//
channel:newChanel,
source_code:newsource_code
}
this.$requst.post('user/login',params,false).then(res => {
uni.setStorageSync('phone_active',res.data.phone_active);
uni.setStorageSync('invite_code',res.data.invite_code);
uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('token',res.data.token);
uni.setStorageSync('openid',res.data.openid)//openid
if(res.data.is_active==0 || res.data.phone_active==0) {
this.$requst.post('user/first-enter',{openid:res.data.openid,path:this.pagePath}).then(res=>{})
}
},error => {})
},
});
} else if(uni.getStorageSync('token')=='' || uni.getStorageSync('phone_active')==0 && uni.getStorageSync('is_active')==0){
this.loginEv(options);
}
this.checkBCate();//
this.checkKey();//
this.checkSwi();//
// this.checkBanner()//
this.$toolAll.tools.buriedPointAll();//id
// this.checkQ();
setTimeout(()=>{
this.quanImg= uni.getStorageSync('quanImg');
this.quanId = uni.getStorageSync('quanId');
},3000)
},
methods: {
loginEv(option){
uni.login({
provider: 'weixin',
success: (res)=> {
var params = {
code:res.code,
invite_code:option.invite_code || '',//
source_code:option.source_code || '',
channel:option.channel || ''
}
this.$requst.post('user/login',params,false).then(res => {
uni.setStorageSync('phone_active',res.data.phone_active);
uni.setStorageSync('invite_code',res.data.invite_code);
uni.setStorageSync('is_active',res.data.is_active)//
uni.setStorageSync('token',res.data.token);
uni.setStorageSync('openid',res.data.openid)//openid
if(res.data.is_active==0 || res.data.phone_active==0) {
// this.$requst.post('user/first-enter',{openid:res.data.openid,path:this.pagePath}).then(res=>{})
}
},error => {})
},
});
},
checkQ(){//
this.$requst.post('user/home-coupon',{},false).then(res=>{
if(res.data.has_coupon==1){
this.isQuan = true;
this.quanImg = this.$http + res.data.home_coupon.cover;
this.quanId = res.data.home_coupon.id;
}
})
},
recerveEv(){//
this.$requst.post('user/get-coupon',{coupon_id:uni.getStorageSync('quanId')}).then(res=>{
if(res.code==0){
this.isQuan = false;
this.$toolAll.tools.showToast('领取成功');
setTimeout(()=>{
uni.navigateTo({
url:'/pagesA/coupon/coupon'
})
},1000)
}
if(res.code==302){
this.$toolAll.tools.showToast(res.msg);
setTimeout(()=>{
uni.navigateTo({
url:'/pages/login/login'
})
},1500)
}
})
},
closeEv(){
this.isQuan = false;
uni.setStorageSync('isQuan',false);
},
//
checkSwi(){
checkBanner({position:'home-banner'}).then(res=>{
if(res.data.length!=0){
res.data.forEach(item=>{
let isVideo = false
if(item.type!='img') isVideo = true
let banObj = {
imgSrc:this.$http + item.src,
url:item.url,
isVideo:isVideo,
poster:this.$http + item.src,
}
this.bannerList.push(banObj)
})
}
})
},
checkNet(){
uni.getNetworkType({
success: (res)=> {
if(res.networkType=='none'){
uni.setStorageSync('isNet',false)
this.isNet = false
if((this.reNum++)==5){
clearInterval(this.refTime)
this.wuNet = '刷新失败'
this.reNum = 0
}
} else {
uni.setStorageSync('isNet',true)
this.isNet = true
clearInterval(this.refTime)
if(this.wuNet == '正在刷新...') {
getCurrentPages()[getCurrentPages().length - 1].onLoad()
}
}
}
});
},
refresh(){
this.wuNet = '正在刷新...'
this.refTime = setInterval(()=>{
this.checkNet()
},1000)
},
bangd(){//
this.$requst.post('').then(res=>{log('绑定客服:',res);},error=>{})
},
tapChoose(index){//
if(this.$toolAll.tools.judgeAuth()){
let newUrl = ''
if(index==0) newUrl = this.gaoone.url
if(index==1) newUrl = this.gaotwo.url
if(index==2) newUrl = this.gaothree.url
uni.navigateTo({
url:newUrl
})
}
},
checkKey(){//
this.$requst.get('index/hot-keywords').then(res=>{
// log('',res);
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let reObj = {title:item.keyword}
this.fwList.push(reObj)
})
}
}
},error=>{})
},
checkBCate(){//
this.$requst.post('index/mini-program-setting',{},false).then(res=>{
// log('',res);
if(res.data.length!=0){
if(res.data.recommend.length!=0){//
res.data.recommend.forEach(item=>{
let bcObj = {
src:this.$http + item.icon,
url:item.link,
title:item.name
}
this.gonggList.push(bcObj)
})
this.gonggList.push({src:this.$http + res.data.recommendMore,title:'更多'})
}
if(res.data.ad.length!=0){//
this.gaoone = {
imgSrc:this.$http + res.data.ad[0].img,
url:res.data.ad[0].link,
}
this.gaotwo = {
imgSrc:this.$http + res.data.ad[1].img,
url:res.data.ad[1].link,
}
this.gaothree = {
imgSrc:this.$http + res.data.ad[2].img,
url:res.data.ad[2].link,
}
}
}
})
},
checkKT(){//
let parmas = {
course_id:this.course_id,//ID
page:this.page,
size:this.size
}
this.$requst.post('archives/course',parmas,false).then(res=>{
// log('',res);
//
if(res.data.course.length!=0){
this.ktList = []
res.data.course.forEach(item=>{
let lObj = {
id:item.id,
title:item.title,
active:item.active
}
this.ktList.push(lObj)
})
}
//
if(this.page==1) this.dataList = []
if(res.data.list.list.length!=0){
this.total = res.data.list.total
res.data.list.list.forEach(item=>{
let fabImg = '';
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
let ktObj = {
category_id:item.category_id,//ID
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: fabImg || this.appletImg,//
name:item.published_by || '恒美植发',//
isVideo:item.video.includes(".mp4"),//
likes:item.likes,//
is_liked:item.is_liked//
}
this.dataList.push(ktObj)
})
}
this.isLoading = true
})
},
praiseEv(e){ //
// console.log(this.dataList[e].is_collected);
if(this.dataList[e].is_liked==0){
this.dataList[e].is_liked = 1;
this.dataList[e].likes++;
//
collectionEV({action:'like',archive_id:this.dataList[e].id})
}
},
chooseLike(e){//
// console.log(this.dataList[e].is_collected);
if(this.dataList[e].is_collected==0){
this.dataList[e].is_collected = 1
this.dataList[e].collects++;
//
collectionEV({action:'collect',archive_id:this.dataList[e].id})
}
},
comfirmev(e){//
this.dataList[e].is_collected = 0
this.$toolAll.tools.showToast('正在取消...','loading')
this.dataList[e].collects--;
//
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
},
chooseGon(index){//
if(this.$toolAll.tools.judgeAuth()){
if(index==(this.gonggList.length-1)){
uni.navigateTo({
url:'/pages/tabbar/cate/cate?index=0'
})
} else {
let existfx = this.gonggList[index].url.indexOf('/');
let newUrl = '';
if(existfx!=0) {
newUrl = `/${this.gonggList[index].url}`;
} else {
newUrl = this.gonggList[index].url;
}
uni.navigateTo({url:newUrl})
}
}
},
choosecateEv(e){//
// log('',e);
this.newCurrent = e
this.isZanw = true
this.page = 1
this.course_id = this.ktList[e].id
this.checkKT()
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
searchEv(){//
// log(this.searchVal);
if(this.$toolAll.tools.judgeAuth()){
this.$requst.post('archives/keyword-check',{keyword:this.searchVal}).then(res=>{
if(res.data.has) {
uni.navigateTo({
url:`/${res.data.target}`
})
} else {
uni.navigateTo({
url:'/pagesB/searchPage/searchPage?keyWorld='+this.searchVal
})
}
})
}
},
chooseReEv(index){
if(this.$toolAll.tools.judgeAuth()){
uni.navigateTo({
url:'/pagesB/searchPage/searchPage?keyWorld='+this.fwList[index].title
})
}
},
//
goAuthPage(){
uni.navigateTo({
url:'/pages/login/login'
})
}
}
}
</script>
<style>
</style>

580
pages/tabbar/shop/shop.vue Normal file
View File

@ -0,0 +1,580 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'商城'" :statusBack="false" :statusTitle="true"></status-nav>
<view class="bacf shop-nav-box" :style="{marginTop:statusHeight+'px'}" style="position: relative;z-index: 3;">
<view class="disac pad-zy30 mar-s20 pad-s20">
<!-- 输入框 -->
<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>
<!-- 自定义轮播 -->
<!-- <swiper-pu :bannerList="bannerList" :isplay="isAutoPlay"></swiper-pu> -->
</view>
<!-- 搜索输入框 -->
<view class="search-input-box bacf shop-nav-box" :style="{top: statusHeight+'px',position:positionMode}" style="padding-top: 10rpx;left: 0;right: 0;z-index: 3;">
<!-- 分类标题 -->
<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>
<!-- 筛选结果 -->
<view v-if="isClick" class="pad-zy50 disac fw pad-x20">
<view class="col3 fon28 mar-s30">筛选</view>
<view v-if="bingVal!=''">{{bingVal}}<view class="mar-z10" @tap="deleteSX(0)">×</view></view>
<view v-if="doctorVal!=''">{{doctorVal}}<view class="mar-z10" @tap="deleteSX(1)">×</view></view>
<view v-if="activityVal!=''">{{activityVal}}<view class="mar-z10" @tap="deleteSX(2)">×</view></view>
</view>
<view v-if="isXiao" @tap="doctorBlur">
<view class="pad-zy30">
<view class="mar-s50 mar-x20 fon28 bold">{{cateTitle}}</view>
<view class="disac fw">
<view @tap.stop="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>
<view class="posir">
<input @tap.stop="chooseEv" type="text" disabled class="mar-x40" v-model="doctor_name" placeholder="请点击选择医生" />
<view v-if="showDoctor" class="posia" style="top: 52px;left: 0;right: 0;border: 1rpx solid #E6E6E6;padding: 20rpx;background: #FFFFFF;max-height: 400rpx;overflow: hidden;overflow-y: scroll;">
<view @tap.stop="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>
<!-- 重置筛选 -->
<view class="disjbac pad-zy20 mar-s50 mar-x30 pad-s20">
<view @tap.stop="chongz">重置</view>
<view @tap.stop="shaix">筛选</view>
</view>
</view>
</view>
<view v-if="isXiao" @tap="closePop" class="moban"></view>
<!-- 数据列表 -->
<!-- <view v-if="loading" :style="{marginTop:statusHNH+titleHeight+(isClick?52:0)+'px'}"> -->
<view v-if="loading" :style="{marginTop:(gaodu==242?titleHeight : 0)+'px'}">
<view v-if="dataList.length!=0 && search_result" class="pad20 ">
<view style="width: 48.6%;float: left;" class="pad-x180">
<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="disjbac" :class="item1.isIntegral ? '' : 'fw'">
<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 class="fon24" style="text-decoration: line-through;color: #C7C7C7;">{{item1.yuanPrice}}</view>
</view>
<view class="fon24 flexs" style="color: #C7C7C7;">销量{{item1.amount}}</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;" class="pad-x180">
<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="disjbac" :class="item1.isIntegral ? '' : 'fw'">
<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 class="fon24" style="text-decoration: line-through;color: #C7C7C7;">{{item1.yuanPrice}}</view>
</view>
<view class="fon24 flexs" style="color: #C7C7C7;">销量{{item1.amount}}</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>
<nothing-page v-if="dataList.length==0" :content="`暂无更多商品列表`"></nothing-page>
</view>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='3'></foot-tab>
<!-- 购物车 -->
<navigator url="/pagesA/shopCart/shopCart?isScore=false" hover-class="none">
<view class="cart-box">
<view class="posir">
<image src="/static/public/cart.png" mode="aspectFill"></image>
<view class="posia" v-if="cartNum!=0"><view>{{cartNum}}</view></view>
</view>
</view>
</navigator>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import shopList from '@/components/shop-list.vue';
import swiperPu from '@/components/swiper-pu.vue';
import {cartNum,checkBanner} from '@/jsFile/publicAPI.js';
export default {
components:{
shopList,
swiperPu
},
data() {
return {
activeIndex:'-1',
shopCate:['全部分类','全部医生','全部活动'],
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,
doctorList:[],
showDoctor:false,
timeList:[],//
zanArr:[],
timer:null,
search_result:false,
bingVal:'',
doctorVal:'',
activityVal:'',
bannerList:[],//
isAutoPlay:false,
optionObj:{},
positionMode:'sticky',
gaodu:0
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onHide() {
this.isAutoPlay = false;
},
onUnload() {
this.isAutoPlay = false;
},
onPageScroll(e) {
if(e.scrollTop>=50){
this.positionMode = "fixed";
this.gaodu = 50;
} else {
this.positionMode = "sticky";
this.gaodu = 0;
}
},
onShow() {
if(uni.getStorageSync('phone')!=0 && uni.getStorageSync('is_active')!=0) {
this.cartNumEv();//
}
this.isAutoPlay = true;
},
onLoad(options) {
this.optionObj = options;
// +
const query = wx.createSelectorQuery()
query.select('.search-input-box').boundingClientRect((rect) => {
// console.log('+',rect.height);
this.titleHeight = rect.height;
}).exec()
// tools.js
this.$toolAll.tools.plantPoint(12);
//
this.checkSwi();
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkSX();
}
},
methods: {
//
checkSwi(){
checkBanner({position:'home-banner'}).then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let isVideo = false
if(item.type!='img') isVideo = true
let banObj = {
imgSrc:this.$http + item.src,
url:item.url,
isVideo:isVideo,
poster:this.$http + item.src,
}
this.bannerList.push(banObj)
})
console.log(this.bannerList);
}
}
})
},
chooseDoctor(index){//
this.shaiList = [];
this.doctor_name = this.doctorList[index].doctor_extra.name;
this.shaiList.push(this.doctor_name);
this.showDoctor = false;
},
chooseEv(){//
this.$requst.post('user/doctor-list',{page:1,size:1000}).then(res=>{
if(res.code==0){
this.doctor_name = '';
if(res.data.list.length!=0){
this.showDoctor = true;
this.doctorList = res.data.list;
} else this.$toolAll.tools.showToast('暂无医生可选');
} else this.$toolAll.tools.showToast(res.msg);
})
},
//
doctorBlur(){
setTimeout(()=>{
this.showDoctor = false;
},500)
},
closePop(){
this.isXiao = false;
this.showDoctor = false;
},
cartNumEv(){//
this.$requst.post('order/shopping-cart-count',{type:'spu'}).then(res=>{
if(res.code==0){
this.cartNum = res.data.count;
}
})
},
async checkSX(){//
this.$requst.get('spu/condition').then(res=>{
if(res.code==0){
this.zanBingArr = res.data;
}
})
await this.checkShopList();
},
chooseShopCate(index){//
uni.pageScrollTo({
scrollTop: this.statusHeight*1,
duration:0
})
if(this.activeIndex==index && this.isXiao) {
this.isXiao = false;
} else this.isXiao = true;
this.bingzList = [];
this.doctor_name = '';//
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(){//
let keyWord = this.searchVal;
if(this.shaiList.length!=0) keyWord = this.shaiList.filter(item=>item!=null).join(',');
let params = {
keyword:'',//
page:1,
size:2000,
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
}
uni.request({
url:`${getApp().globalData.hostApi}spu/list`,
data:params,
method:'post',
header:{
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
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;
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)
group_cover.push(item)
})
}
let obj = {
id:item.id,
imgSrc: this.$http + item.cover,
title: item.name,
zhePrice:item.price/100,
yuanPrice:item.original_price/100,
integral:'',
amount:item.amount,//
isTuan:tuan,//
isPing:ping,//
isXian:xian,//
isIntegral:integral,//
grade:'',
disease_name:item.disease_name,//
reponseTime:res.header.Date,//
activity_end_at:item.activity_end_at,//
activity_group_cover:group_cover,//
activity_group_num:item.activity_group_num,//
activity_id:item.activity_id,
spu_type:item.spu_type//
}
this.zanArr.push(obj)
})
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.length!=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;
this.loading = true;
},1000)
} else {
this.dataList = this.zanArr;
this.search_result = true;
this.loading = true;
}
} else {
this.search_result = true;
}
}
}
})
},
goPage(id,index){//
let is_activity = 0;
let shopId = 0;
if(this.dataList[index].isTuan==true || this.dataList[index].isPing==true || this.dataList[index].isXian==true) {
is_activity = 1;
shopId = this.dataList[index].activity_id;
} else {
shopId = id;
}
uni.navigateTo({
url:`/pagesB/shopDetail/shopDetail?id=${shopId}&isIntegral=${this.dataList[index].isIntegral}&is_activity=${is_activity}`
})
},
chooseBing(index){//
this.bingzList.forEach(item=>{
item.isActive = false;
})
this.bingzList[index].isActive = true;
// id
if(this.activeIndex===0) {
this.disease_id = this.bingzList[index].id;
this.bingVal = this.bingzList[index].title;
}
//
if(this.activeIndex===1) {
this.doctor_role = this.bingzList[index].name;
this.doctorVal = this.bingzList[index].title;
}
// type
if(this.activeIndex===2) {
this.activity = this.bingzList[index].name;
this.activityVal = this.bingzList[index].title;
}
},
chongz(){//
this.isClick = false;
this.bingVal = '';
this.doctorVal = '';
this.activityVal = '';
},
shaix(){//
this.isXiao = false
this.isClick = true;
this.checkShopList();
},
deleteSX(index){//
if(index==0) {
this.disease_id = '';
this.bingVal = '';
}
if(index==1) {
this.doctor_role = '';
this.doctorVal = '';
}
if(index==2) {
this.activity = '';
this.activityVal = '';
}
if(this.activity=='' && this.doctorVal == '' && this.activityVal == ''){
this.isClick = false;
}
this.checkShopList();
},
searchEv(){//
uni.navigateTo({
url:`/pagesB/shopSearch/shopSearch?keyWorld=${this.searchVal}`
})
}
}
}
</script>
<style>
page{background: #F5F5F5;}
.activecate,.shopMo{width: 216rpx;height: 65rpx;border-radius: 20rpx;line-height: 65rpx;text-align: center;background-color: #f2f2f2;color: #333333;}
.activecate{color: #FFFFFF;}
.shopMo span::after,.activecate span::after{display: inline-block;content: '';width: 16rpx;height: 13rpx;margin-left: 6rpx;}
.shopMo span::after{background: url(/static/public/shopSJ.png) no-repeat;background-size: 100% 90%;}
.activecate span::after{background: url(/static/public/shopSJ-active.png) no-repeat;background-size: 100% 90%;transform: rotate(180deg);background-position: 0 2rpx;}
</style>

View File

@ -0,0 +1,245 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'活动任务'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy32 pad-x20">
<!-- 签到领积分 -->
<view v-for="(item,index) in activityList" :key="index" class="bacf radius20 pad20 mar-s20">
<view class="bold col3 disjbac">
<view class="disac">
<image :src="item.imgSrc" style="width: 60rpx;height: 60rpx;margin-right: 20rpx;" mode=""></image>
<view class="fon28">{{item.title}}</view>
</view>
<view><span style="color: #3875F6;">{{item.danc}}</span>/{{item.allc}}</view>
</view>
<view class="fon24" style="color: #808080;">
<view class="mar-s30">活动要求{{item.description}}</view>
<view class="mar-s20">获得奖励{{item.amount}} <span v-if="item.isIcon!=1"></span><span v-else></span></view>
<view class="mar-s20">会员暂无</view>
<view class="mar-s20">开始时间{{item.startTime}}</view>
<view class="mar-s20">结束时间{{item.endTime}}</view>
</view>
<view class="disjcac">
<!-- 线上签到 -->
<view v-if="item.ntype=='sign_in'" class="disja">
<view v-if="item.danc!=item.allc" @tap="goTosigin" class="mar-s30 activity-dai"></view>
<view v-if="item.danc==item.allc && item.account_status!=1" @tap="btnEv(index)" class="mar-s30 activity-mo" style="background: #f8bf2c;"></view>
<view v-if="item.danc==item.allc && item.account_status==1" class="activity-mo mar-s30"></view>
</view>
<!-- 分享截图任务 -->
<view v-if="item.ntype=='share_screenshots'" class="disja">
<!-- <view @tap="btnEv(index)" class="activity-dai mar-s30">立即完成</view> -->
<view v-if="item.account_status==3 || item.account_status==4" @tap="btnEv(index)" class="activity-dai mar-s30"></view>
<view v-if="item.account_status==0" class="activity-mo mar-s30">...</view>
<view v-if="item.account_status==2" @tap="btnEv(index)" class="activity-dai mar-s30"></view>
<view v-if="item.account_status==1" class="activity-mo mar-s30"></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"></view>
<view v-else class="activity-mo mar-s30">已完成</view>
</view>
<!-- 分享注册任务 -->
<view v-if="item.ntype=='share'">
<view v-if="item.account_status==4" @tap="btnEv(index)" class="mar-s30 activity-dai"></view>
<view v-else class="activity-mo mar-s30">已完成</view>
</view>
</view>
</view>
<!-- 上传截图弹框 -->
<view v-if="isScreenshot" @tap.stop="isScreenshot=false,upImg=''" class="posAll disjcac" style="padding: 0 85rpx;z-index: 3;">
<view class="bacf width100" @tap.stop="isScreenshot=true" style="padding: 0 33rpx;border-radius: 20rpx;">
<view class=" disjcac fc">
<view class="fon32 col3 mar-s30 mar-x40">截图上传</view>
<view v-if="upImg==''" @tap="chooseImg" class="task-add-box disjcac fc">
<view class="posir disjcac mar-s50">
<view class="posia task-add" style="transform: rotate(90deg);"></view>
<view class="posia task-add"></view>
</view>
<view class="fon28 col9" style="margin-top: 120rpx;">点击上传截图</view>
</view>
<image v-else @tap="chooseImg" class="imgIng" :src="upImg" mode="aspectFill"></image>
</view>
<view class="disjbac mar-x20 tc">
<view @tap.stop="isScreenshot=false,upImg=''" class="task-cancle-btn">取消</view>
<view @tap.stop="shareEv" class="task-confrim-btn">确定</view>
</view>
</view>
</view>
</view>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
isScreenshot:false,
upImg:'',
chooseIndex:0,
activityList:[],//
isNum:0,
siginVal:'立即签到',
partakeVal:'立即完成',
}
},
onShow() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkList();
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
}
},
onLoad() {},
methods: {
btnEv(index){
this.chooseIndex = index;
if(this.activityList[index].ntype=='share_screenshots' && (this.activityList[index].account_status!=0 || this.activityList[index].account_status==2)){//
this.isScreenshot = true;
}
if(this.activityList[index].ntype=='offline_sign_in' && this.activityList[index].account_status==4){//线
this.$toolAll.tools.showToast('请先完成任务,再来领取')
}
if(this.activityList[index].ntype=='share' && this.activityList[index].account_status==4){//
uni.navigateTo({
url:'/pagesB/personalPoster/personalPoster'
})
}
if(this.activityList[index].danc == this.activityList[index].allc) {
if(this.isNum==0) {
this.isNum++;
this.$requst.post('task/task/complete-task',{task_id:this.activityList[index].id}).then(res=>{
if(res.code==0){
this.isNum = 0;
this.checkList();
} else {
setTimeout(()=>{
this.isNum = 0;
},2000)
this.$toolAll.tools.showToast(res.msg);
}
})
}
}
setTimeout(()=>{
this.isNum = 0;
},2000)
},
checkList(){//
this.$requst.post('task/task/task-list').then(res=>{
if(res.code==0){
this.activityList = [];
if(res.data.length!=0){
res.data.forEach(item=>{
let nIcon = 0;
let nimg = '/static/public/task-01-60.png';
if(item.icon==1) {
nimg = '/static/public/task-02-60.png';
nIcon = 1;
}
if(item.icon==2) {
nimg = '/static/public/task-03-60.png';
nIcon = 2;
}
if(item.icon==3) {
nimg = '/static/public/task-04-60.png';
nIcon = 3;
}
let obj = {
id:item.id,
imgSrc:nimg,//icon
title:item.title,//
danc:item.completed_quantity,//
allc:item.cycle,//
description:item.description,//
amount:item.reward_number,//
account_status:item.account_status,
member:'',//
isStatus:item.status,
startTime:item.start_at,//
endTime:item.end_at,//
isIcon:nIcon,// 0 1 2 3
ntype:item.type//
}
this.activityList.push(obj);
})
}
// account_status: 1 0 1 2 3
// completed_quantity: 0
// create_time: "2021-10-20 18:12:37"
// cycle: 1
// description: ""
// end_at: "2021-10-30"
// id: 4 id
// long_term: 0 0
// repeat: 0
// reward_number: 10
// reward_type: "coin"
// start_at: "2020-10-20"
// status: 1 1 0
// title: ""
// type: "share_screenshots" 'share','sign_in','offline_sign_in','share_screenshots' 线
}
})
},
chooseImg(){//
uni.chooseImage({
count:1,
sourceType:['album'],
success: (res) => {
this.upImg = res.tempFilePaths[0];
this.$requst.upload('file/upload/image',{file:this.upImg}).then(res=>{
this.upImg = this.$http + res.data.src;
this.$toolAll.tools.showToast('图片上传成功(*^▽^*)')
this.isNum = 1;
},error=>{})
}
})
},
shareEv(){//
if(this.isNum==1) {
this.isNum++;
this.$requst.post('task/task/complete-task',{task_id:this.activityList[this.chooseIndex].id,image:this.upImg}).then(res=>{
if(res.code==0){
this.isNum = 0;
this.isScreenshot = false;
this.upImg = '';
this.$toolAll.tools.showToast('截图已上传');
this.checkList();
} else {
setTimeout(()=>{
this.isNum = 0;
},2000)
this.$toolAll.tools.showToast(res.msg);
}
})
}
},
goTosigin(){
uni.navigateTo({
url:'/pagesA/signIn/signIn'
})
}
}
}
</script>
<style>
.isWen{color: #3875F6;}
.isWen::after{
content: '';
display: block;
height: 8rpx;
width: 80%;
position: absolute;
bottom: -20rpx;
left: 50%;
transform: translateX(-50%);
background: #3875F6;
}
</style>

203
pagesA/coupon/coupon.vue Normal file
View File

@ -0,0 +1,203 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'优惠券'" :statusTitle="true"></status-nav>
<view id="daoh" class="bacf pad-zy40 pad-sx20 isTopf fon28 col3 disjbac" :style="{top:statusHeight+'px'}">
<view @tap="chooseNav(indexn)" :class="isStatus==indexn?'isWen bold':''" class="posir" v-for="(itemn,indexn) in navList" :key="indexn">{{itemn}}</view>
</view>
<!-- 列表 -->
<view :style="{paddingTop: (statusHeight+chuTop+15)+'px'}" class="pad-zy32">
<view class="pad-x30">
<view v-if="dataList.length!=0" class="mar-x20 animated fadeInLeft" v-for="(item,index) in dataList" :key="index">
<view style="height: 200rpx;" class="disjbac posir">
<view class="disjcac fc recerve-left" style="width: 218rpx;height: 200rpx;flex-shrink: 0;text-align: center;color: #FFFFFF;">
<image v-if="item.statusNum!=0 && item.statusNum!=2" class="posia quan-img" src="/static/public/quan-left-two.png" mode=""></image>
<image v-else class="posia quan-img" src="/static/public/quan-left.png" mode=""></image>
<view class="posir disjcac fc" style="z-index: 1;">
<view class="fon28 mar-s20 mar-x36"><span v-if="!item.isTiyan && !item.isZhek">¥</span><span class="bold" style="font-size: 56rpx;">{{item.num}}</span></view>
<view v-if="item.statusNum==0 || item.statusNum==2" @tap="useEv(index)" class="fon24 quan-btn">{{item.statusNum==2?'':'使'}}</view>
</view>
</view>
<view class="quan-right-box">
<view class="fon28 col3 mar-s20">{{item.title}}</view>
<view class="fon24 col80">{{item.manPrice}}元可使用</view>
<view class="fon20 col80 mar-x20">有效期{{item.startTime}}{{item.endTime}}</view>
</view>
<image v-if="item.statusNum==1" class="posia quan-use" src="/static/public/quan-use.png" mode=""></image>
<image v-if="item.statusNum==3" class="posia quan-use" src="/static/public/quan-over.png" mode=""></image>
</view>
</view>
<block v-if="loading">
<nothing-page v-if="dataList.length==0" :content="['暂无可使用优惠券','暂无已使用优惠券','暂无可领取优惠券','暂无已过期优惠券'][isStatus]"></nothing-page>
</block>
</view>
</view>
<!-- 体验券使用弹框 -->
<view v-if="isTY" @tap="isTY=false" class="disjcac tc quan-tk-box" catchtouchmove="return">
<view class="bacf width100 radius20 pad30 posir" style="margin: 0 128rpx;" @tap.stop="isTY=true">
<view class="fon28 col3">体验券使用</view>
<view class="mar-sx30">
<!-- <image :src="tyImg" class="quan-tk-em" style="width: 325rpx;height: 325rpx;" mode="aspectFill"></image> -->
<yz-qr ref="qrPath" :text="text" :size="sizeq" :colorDark="colorDark" :colorLight="colorLight"></yz-qr>
</view>
<view class="fon24 col3 mar-s40 mar-x20">工作人员扫码使用体验券</view>
<image @tap.stop="closeQuanEv" src="/static/public/closequan.png" class="posia quan-tk-btn" mode=""></image>
</view>
</view>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import yzQr from '@/components/yz-qr/yz-qr.vue';
export default {
components:{
yzQr
},
data() {
return {
chuTop:'',
navList:['未使用','已使用','可领取','已过期'],
isStatus:0,
dataList:[],
zcList:[],
isTY:false,
page:1,
size:10,
quanStatus:'normal',//
loading:false,
tyImg:'',//使img
canvasQrPath: '',
text: 'hello',
sizeq: 162,
colorDark: '#000000',
colorLight: '#ffffff',
timer:null,
secret:''
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
}
},
onLoad() {
const query = wx.createSelectorQuery()
query.select('#daoh').boundingClientRect((rect) => {
// console.log('+',rect);
this.chuTop = rect.height;
}).exec()
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkAllList(0);
}
},
onUnload() {
this.closeQuanEv();
},
methods: {
checkAllList(index){//
let params = {
status: this.quanStatus,// normal=使 used=使 invalid= waiting=
page:this.page,
size:this.size
}
this.$requst.post('user/get-coupon-list',params).then(res=>{
if(res.code==0){
this.dataList = [];
this.zcList = [];
if(res.data.length!=0){
res.data.forEach(item=>{
let leix = false;
if(item.type=='taste') leix = true;
let obj = {
id:item.id,
num:item.amount/100,
title:item.name,
cover:this.$http + item.cover,
manPrice:item.condition/100,
startTime:item.begin_at.slice(0,10),
endTime:item.end_at.slice(0,10),
isTiyan:leix,
isZhek:false,
statusNum:index
}
this.dataList.push(obj);//
this.zcList.push(obj);//
})
this.checkList(index);
}
this.loading = true;
}
})
},
chooseNav(index){
this.isStatus = index;
if(index==0) this.quanStatus = 'normal';//使
if(index==1) this.quanStatus = 'used';//使
if(index==2) this.quanStatus = 'waiting';//
if(index==3) this.quanStatus = 'invalid';//
this.loading = false;
this.checkAllList(index);
},
checkList(index){
this.dataList = this.zcList.filter(item=>item.statusNum==index);
},
useEv(index){
if(this.dataList[index].statusNum==2) {
this.$requst.post('user/get-coupon',{coupon_id:this.dataList[index].id}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('领取成功');
this.checkAllList(this.isStatus);
} else {
this.$toolAll.tools.showToast(res.msg);
}
})
}
if(this.dataList[index].isTiyan==false && this.dataList[index].statusNum==0) {
uni.navigateTo({url:'/pages/tabbar/shop/shop'})
}
if(this.dataList[index].isTiyan==true && this.dataList[index].statusNum==0){
this.tyImg = this.dataList[index].cover;
this.$requst.post('user/exhibition-experience-coupon',{coupon_id:this.dataList[index].id}).then(res=>{
if(res.code==0){
this.isTY = true;
this.text = `${this.dataList[index].id}HtrueH${res.data.secret}H${uni.getStorageSync('userId')}`;
this.secret = res.data.secret;
} else this.$toolAll.tools.showToast(res.msg);
},error=>{})
this.timer = setInterval(()=>{
this.$requst.post('staff/coupon/write-off-experience-couponQuery',{coupon_id:this.dataList[index].id,secret:this.secret}).then(res=>{
if(res.code==0){
// if(res.data.result==0){
this.$toolAll.tools.showToast('使用成功');
this.isTY = false;
clearInterval(this.timer);
this.checkAllList(0);
// }
}
})
},3000)
}
},
closeQuanEv(){
this.isTY = false;
clearInterval(this.timer);
}
}
}
</script>
<style>
.isWen{color: #3875F6;}
.isWen::after{
content: '';
display: block;
height: 8rpx;
width: 100%;
position: absolute;
bottom: -20rpx;
background: #3875F6;
}
</style>

View File

@ -0,0 +1,818 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'购物车'" :statusTitle="true"></status-nav>
<view v-if="loading" :style="{paddingTop: statusHeight+'px'}" class="pad-zy30" style="padding-bottom: 150rpx;">
<view class="bacf radius20 mar-s20 disjbac pad-sx27-zy20">
<view class="bold">配送方式</view>
<view class="fon26 col3 disac">
<view @tap="expressEv(1)" :class="!isExpress?'activeT':'expressT'" :style="{background:isExpress?'':publicColor}">自提</view>
<view v-if="!isVirtual" @tap="expressEv(0)" :class="isExpress?'activeT':'expressT'" :style="{background:isExpress?publicColor:''}"></view>
</view>
</view>
<!-- 地址信息 -->
<view v-if="isExpress" class="bacf radius20 mar-s20 pad-sx27-zy20">
<view class="bold">收件人信息</view>
<navigator url="/pagesA/myAddress/myAddress?isWhere=0" hover-class="none">
<view class="fon26 col3 disjbac pad-s50">
<view v-if="addressInfo!=''">
<view class="fon28 col3 bold mar-x20">{{addressInfo.name}} <span class="mar-z20">{{userPphone}}</span></view>
<view class="fon24 col9">{{addressInfo.province_str}}{{addressInfo.city_str}}{{addressInfo.county_str || ''}}{{addressInfo.address || ''}}</view>
</view>
<view v-else class="fon24 col9">请完善收件人信息</view>
<image src="/static/public/nextM.png" class="xiaDan-next" mode="aspectFill"></image>
</view>
</navigator>
</view>
<!-- 自提地址 -->
<view v-else class="bacf radius20 mar-s20 pad-sx27-zy20">
<view class="bold">自提地址</view>
<input type="number" maxlength="11" :focus="isFocus" @blur="blurEv" v-model="zPhone" class="mar-s50 mar-x20" style="border: 2rpx solid #E0E0E0;padding: 20rpx;border-radius: 10rpx;font-size: 24rpx;" placeholder="请输入收货人手机号" />
<view class="fon26 col3 disjbac">
<view>
<view class="fon28 col3 bold mar-x20">Company</view>
<view class="fon24 col9">{{goAddress}}</view>
</view>
<!-- 立即导航 -->
<image @tap="goThere(goAddress)" src="/static/public/daoh.png" class="there" mode="aspectFill"></image>
</view>
</view>
<!-- 订单信息 -->
<view class="bacf radius20 mar-s20 pad-sx27-zy20">
<view class="bold">订单信息</view>
<view v-for="(item,index) in orderList" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
<image lazy-load @tap="goShopDetail(item.id)" :src="item.imgSrc" class="flexs order-image" mode="aspectFill"></image>
<view class="width100 disjb fw" style="height: 166rpx;">
<view>
<view @tap="goShopDetail(item.id)" class="fon28 col3 bold clips2">{{item.title}}</view>
<view class="order-sy">{{item.sku_name}}</view>
</view>
<view class="disjbac mar-s10 width100">
<view class="order-item-price" v-if="isNei!=3">{{item.price}}</view>
<view class="order-item-price" v-else>{{item.price}}</view>
<view class="fon28 col6">x{{item.num}}</view>
</view>
</view>
</view>
<view class="fon28 disjbac mar-s20 pad-s10">
<view class="col6">{{allNum}}</view>
<view class="bold colf8" v-if="isNei!=3">{{zanAllPrice}}</view>
<view class="bold colf8" v-else>{{allPrice}}</view>
</view>
</view>
<!-- 选择支付方式 -->
<view class="bacf radius20 mar-s20 fon28 col3 pad-sx30 pad-zy20">
<view class="bold fon28">选择支付方式</view>
<view @tap="chooseFS(index)" v-for="(item,index) in payFS" :key="index" v-if="isCurrent!=index" class="disjbac mar-s30">
<view class="disac">
<image v-if="item.isActive" src="/static/public/chooseFS.png" class="chooseDX" mode=""></image>
<image v-else src="/static/public/cancle-FS.png" class="chooseDX" mode=""></image>
<view class="mar-z25">{{item.title}}</view>
</view>
<view v-if="item.num!=0">{{item.num}}</view>
</view>
</view>
<!-- 优惠 -->
<view v-if="isNei!=3" class="bacf radius20 mar-s20 pad-sx27-zy20">
<view class="bold">优惠</view>
<view @tap="quanEv(1)" class="fon28 col3 disjbac mar-sx40">
<view>优惠券</view>
<view class="disac">
<view class="colf8 bold">-{{youQuan.youPrice}}</view>
<image src="/static/public/nextM.png" class="xiaDan-next" mode="aspectFill"></image>
</view>
</view>
</view>
<!-- 快递费用 -->
<view v-if="isExpress" class="bacf radius20 mar-s20 disjbac pad-sx27-zy20">
<view class="bold">快递费用</view>
<view class="fon28 colf8 bold">{{expressInfo.default_price}}</view>
</view>
<view class="disjbac posixzy bacf pad-zy32" style="height: 124rpx;line-height: 124rpx;">
<!-- 去支付 -->
<view class="fon36 colf8 bold" v-if="isNei!=3">{{allPrice<0?0:allPrice}}<span v-if="isKq">+{{zf_kqPrice}}</span><span v-if="isExpress && expressInfo.default_price!=0" style="font-size: 24rpx;color: #000;">+ {{expressInfo.default_price}}</span></view>
<view class="fon40 colf8 bold dis" v-else><span class="col3 fon28">合计积分</span>{{allPrice}}<span v-if="isExpress && expressInfo.default_price!=0">+ {{expressInfo.default_price}}</span></view>
<view @tap="goPayment" v-if="isNei!=3" class="goPayment"></view>
<view @tap="isDui=true" v-else class="goPayment">去兑换</view>
</view>
</view>
<view v-if="showQuan" @tap.stop="showQuan=false" class="posAll">
<view class="bacf posixzy" style="border-radius: 40rpx 40rpx 0rpx 0rpx;" @tap.stop="showQuan=true">
<view class="pad-sx20 pad-zy50">
<view class="disjbac">
<view class="fon28 bold col3">可用优惠券({{quanList.length}})</view>
<image @tap.stop="showQuan=false" src="/static/public/cha-close.png" style="width: 30rpx;height: 30rpx;" mode="aspectFill"></image>
</view>
<!-- <view class="fon28 bold col3 disja pad-s50" style="padding-bottom: 16rpx;">
<view class="posir" :class="switchQuan?'activeQuan':''" @tap="switchQuan=true">(1)</view>
<view class="posir" :class="!switchQuan?'activeQuan':''" @tap="switchQuan=false">(0)</view>
</view> -->
<scroll-view scroll-y class="mar-s40 quan-list-box">
<view @tap.stop="chooseQuan(index)" v-for="(item,index) in quanList" :key="index" class="mar-x40">
<view class="disjbac quan-item-box">
<view class="posir">
<image class="posia" src="/static/public/quan-left.png" mode=""></image>
<view class="posir" style="z-index: 1;">
<view class="pad-s40 pad-x30 fon28"><span class="bold fon56">{{item.youPrice}}</span></view>
<view class="fon24" style="padding-left: 12rpx;">{{item.manPrice}}元可使用</view>
</view>
</view>
<view>
<!-- <view class="fon28 col3 mar-s20">{{['黄金','白银'][item.isGrade]}}会员专属优惠券</view> -->
<view class="fon28 col3 mar-s20">{{item.name}}</view>
<view>
<image v-if="item.isStatus" src="/static/public/chooseQuan.png"></image>
<image v-else src="/static/public/cancleQuan.png"></image>
</view>
<view class="fon20 col3 mar-x20">有效期{{item.startTime.slice(0,10)}}{{item.endTime.slice(0,10)}}</view>
</view>
</view>
</view>
</scroll-view>
<!-- 领取优惠券按钮 -->
<view @tap.stop="goCoupon" class="ling-btn">领取优惠券</view>
</view>
</view>
</view>
<!-- 确认兑换弹框 -->
<view v-if="isDui" @tap.stop="isDui=false" class="posAll zhun-dui-box">
<view class="bacf radius20 width100 tc fon28 col3 pad20" @tap.stop="isDui=true">
<view class="bold" style="margin: 0rpx 0 56rpx 0;">兑换商品</view>
<view style="margin: 0rpx 0 66rpx 0;">您确定使用{{allPrice}}积分兑换吗</view>
<view class="disjbac mar-x20 pad-zy20 zhun-dui-btn">
<view @tap.stop="isDui=false">暂不兑换</view>
<view @tap.stop="goPayment">立即兑换</view>
</view>
</view>
</view>
<!-- 支付成功 -->
<view v-if="isSuccess" class="posAll" :style="{top:statusHeight+'px'}" style="z-index: 3;background-color: #F5F5F5;">
<view class="bacf radius20 mar-s20 mar-zy20 success-box">
<image src="/static/public/pay-success.png" mode=""></image>
<view class="fon28 col3 pad-s20 pad-x40">支付成功</view>
<view class="success-hj"><span v-if="isNei!=3">{{jsPrice<0?0:jsPrice}}</span><span v-else>{{jsPrice}}</span></view>
<view class="disja success-btn">
<view @tap="goDetail"></view>
<view @tap="goShop" class="colf" :style="{background:publicColor}">再逛一逛</view>
</view>
</view>
</view>
<!-- 分享弹框 -->
<view v-if="isfen" class="posAll disjcac" style="background-color: rgba(0,0,0,.25);z-index: 8;">
<view class="bacf width100 radius20 posir" style="padding: 60rpx 50rpx;margin: 0 70rpx;text-align: center;">
<image @tap="isfen=false" src="../../static/public/closequan.png" class="posia heyan-close" mode=""></image>
<view style="color: #f55255;font-size: 36rpx;">立即完成拼单?</view>
<view style="margin: 50rpx 0;font-size: 26rpx;">点击下方分享给朋友完成拼单</view>
<view class="posir radius15 disjcac pad-sx20" style="background-color: #22cc3e;color: #FFFFFF;font-size: 36rpx;">
分享给朋友
<button open-type="share" class="posia-op">分享给朋友</button>
</view>
</view>
</view>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
isExpress:false,
switchQuan:true,
showQuan:false,//
isDui:false,
orderList:uni.getStorageSync('orderList'),
quanList:[],
goAddress:'四川省成都市成华区双店路B口',
youQuan:{
id:0,
youPrice:0
},//
allPrice:0,//
allNum:0,//
zanAllPrice:0,//
isNei:0,
expressInfo:{},//
addressInfo:'',//
userPphone:'请完善信息',
zPhone:'',//
page:1,
size:10,
isFocus:false,
loading:false,
zf_allPrice:0,//
zf_kqPrice:0,//
payFS:[
{title:'微信支付',isActive:true,num:0},
{title:'孔雀币',isActive:false,num:100},
{title:'积分',isActive:false,num:100},
],
isKq:false,
jsPrice:0,//,
zc_allPrice:0,//
coin_price:0,//
isSuccess:false,//
ntype:'money',//money coin
times:0,//
isCurrent:2,
isfen:false,
checkGrounpId:0,
expressInfo:{
default_price:0
},
isVirtual:false,//
payType:''// wechat=;coin=;hybrid=
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onShareAppMessage(res) {
var shareObj = {
     title: this.orderList[0].title, // (slogan)
     path: `/pagesB/shopDetail/shopDetail?id=${this.orderList[0].id}&category_id=0&is_activity=${this.orderList[0].is_activity}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
     imageUrl: this.orderList[0].imgSrc//PNGJPG imageUrl 使 5:4
  };
  return shareObj;
//   return false;
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
this.checkChoose();//
uni.removeStorageSync('orderInfo');
},
onLoad(options) {
// wechat=;coin=;hybrid=
// this.payType = uni.getStorageSync('payType');
this.payType = 'wechat';
if(this.payType=='wechat') {
this.payFS = [{title:'微信支付',isActive:true,num:0}]
} else if(this.payType=='coin'){
this.payFS = [{title:'孔雀币',isActive:true,num:0}]
} else if(this.payType=='hybrid'){
this.payFS = [
{title:'微信支付',isActive:true,num:0},
{title:'孔雀币',isActive:false,num:0}
]
}
//
this.zPhone = uni.getStorageSync('phone');
//
options.isVirtual == "virtual" ? this.isVirtual = true : this.isVirtual = false
this.checkexpress();//
this.checkeList(options.isNei);//
this.checkOrderDetail();//
this.isNei = options.isNei;
if(this.isNei==3) {
this.payFS[0].isActive = false;
this.payFS[2].isActive = true;
this.isCurrent = 1;
}
},
methods: {
checkChoose(){
if(uni.getStorageSync('chooseAddress')==''){
this.checkAddress();//
} else {
let naddress = uni.getStorageSync('chooseAddress');
this.addressInfo = {
id:naddress.id,
name:naddress.userName,
phone:naddress.userPhone,
province_str:naddress.province,
city_str:naddress.city,
county_str:naddress.county,
address:naddress.address
}
this.userPphone = this.$toolAll.tools.hideMPhone(naddress.userPhone);
}
},
obtainCoin(coinNum){//
this.$requst.post('user/get-coin-price',{amount:coinNum,get_type:this.ntype}).then(res=>{
if(res.code==0){
if(this.ntype=='money'){
this.coin_price = res.data.amount/100;
if(this.payType=='coin'){
//
if(this.zanAllPrice - this.coin_price<=0){//
this.allPrice = 0;
this.zf_kqPrice = this.zanAllPrice*1;
} else {//
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
this.zf_kqPrice = this.coin_price;
}
this.isKq = true;
}
} else {
this.zf_kqPrice = res.data.amount;
this.isKq = true;
}
}
})
},
goShopDetail(id){
uni.navigateTo({
url:`/pagesB/shopDetail/shopDetail?id=${id}`
})
},
chooseFS(index){
this.payFS[index].isActive = !this.payFS[index].isActive;
if(this.isNei==3){//
if(!this.payFS[0].isActive && !this.payFS[2].isActive){
this.$toolAll.tools.showToast('请选择支付方式');
this.allPrice = this.zanAllPrice;
this.isKq = false;
return;
}
} else {//
if(this.payType!='coin'){
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
this.$toolAll.tools.showToast('请选择支付方式')
this.allPrice = this.zanAllPrice;
this.isKq = false;
this.zf_kqPrice = this.payFS[1].num;
return;
}
}
}
if(this.payFS[index].title=='微信支付'){
if(this.isNei!=3){
//+
if(this.payFS[0].isActive && this.payFS[1].isActive){
if(this.zanAllPrice - this.coin_price >=0){//
this.allPrice = this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price);
this.zf_kqPrice = this.payFS[1].num;
} else {//
this.allPrice = 0;
this.ntype = 'coin';
this.obtainCoin(this.zanAllPrice*100);
}
return;
}
//+
if(!this.payFS[0].isActive && this.payFS[1].isActive){
if(this.zanAllPrice - this.coin_price>0){
this.$toolAll.tools.showToast('孔雀币不足');
}
return;
}
//+
if(this.payFS[0].isActive && !this.payFS[1].isActive){
this.isKq = false;
this.zf_kqPrice = 0;
return;
}
} else {
if(this.expressInfo.default_price==0){
this.$toolAll.tools.showToast('暂不可微信支付');
this.payFS[index].isActive = false;
}
}
}
if(this.payFS[index].title=='孔雀币') {
if(this.payType!='coin'){
if(this.youQuan.youPrice!=0){
this.payFS[1].isActive = false;
this.$toolAll.tools.showToast('无法使用孔雀币支付');
} else {
if(this.coin_price!=0){
//+
if(this.payFS[0].isActive && this.payFS[1].isActive) {
if(this.zanAllPrice - this.coin_price<=0){//
this.ntype = 'coin';
this.obtainCoin(this.zanAllPrice*100);
this.allPrice = 0;
} else {//
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
this.zf_kqPrice = this.payFS[1].num;
}
this.isKq = true;
return;
}
//+
if(this.payFS[0].isActive && !this.payFS[1].isActive) {
this.isKq = false;
this.zf_kqPrice = 0;
// 0
if(this.youQuan.youPrice==0){
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice)*1).toFixed(2);
} else {
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.youQuan.youPrice)*1).toFixed(2);
}
return;
}
//+
if(!this.payFS[0].isActive && this.payFS[1].isActive){
if(this.zanAllPrice - this.coin_price<=0){//
this.ntype = 'coin'
this.obtainCoin(this.allPrice*100);
this.allPrice = 0;
}
if(this.zanAllPrice - this.coin_price>0){//
this.$toolAll.tools.showToast('孔雀币不足')
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
this.zf_kqPrice = this.payFS[1].num;
}
return;
}
//+
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
this.isKq = false;
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice)*1).toFixed(2);
return;
}
} else {
this.$toolAll.tools.showToast('暂无可用孔雀币');
this.payFS[index].isActive = false;
}
}
} else {
if(!this.payFS[index].isActive) {
this.isKq = false;
this.zf_kqPrice = 0;
this.allPrice = this.zanAllPrice;
} else {
//
if(this.zanAllPrice - this.coin_price<=0){//
this.ntype = 'coin';
this.obtainCoin(this.zanAllPrice*100);
this.allPrice = 0;
} else {//
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
this.zf_kqPrice = this.payFS[0].num;
}
}
}
}
},
goPayment(){//
this.isFocus = false;
this.isDui = false;
let nphone = '';
if(this.isExpress) {
nphone = this.addressInfo.phone;//
} else nphone = this.zPhone;//
let self = 0;//
if(!this.isExpress) self = 1;//
let nsku_list = [];
let is_only = 0;
this.orderList.forEach(item=>{
let obj = {
sku_coding:item.coding,
num:item.num,
group_id:item.pin_user_id
}
nsku_list.push(obj);
is_only = item.is_only;
})
let is_score = 0;
if(this.isNei == 3) {is_score = 1}
if(this.zf_kqPrice!=0) {
this.jsPrice = `${this.allPrice} +${this.zf_kqPrice}孔雀币`;
} else {
this.jsPrice = this.allPrice;
}
let parmas = {
sku_list: nsku_list,//
total: this.allPrice*100,//
address_id: this.addressInfo.id || 0,//ID
express_code: this.expressInfo.code || 0,//
coupon_id: this.youQuan.id,//ID
coupon_price: this.youQuan.youPrice*100,//
pick_self: self,//0 1
pick_self_phone: nphone,//
original_total: this.zanAllPrice*100,//
freight: this.expressInfo.default_price || 0,//
remarks: "",//
is_only:is_only,//0 12
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.expressInfo.default_price!=undefined && !this.payFS[0].isActive){//
this.$toolAll.tools.showToast('请添加微信支付方式');
} else if(this.isNei != 3 && !this.payFS[0].isActive && !this.payFS[1].isActive){
this.$toolAll.tools.showToast('请选择支付方式')
} else if(this.payType=='coin' && this.allPrice*1 > this.coin_price*1){
this.$toolAll.tools.showToast('孔雀币不足');
} else if(this.payType=='hybrid' && 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:`${getApp().globalData.hostApi}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,'none',3000);
this.times = 0;
}
}
})
}
}
},
payment(info){
if(info.needPay){
uni.requestPayment({
provider: 'wxpay',
appId:info.payment_params.appId,//appId
timeStamp: info.payment_params.timeStamp,//
nonceStr: info.payment_params.nonceStr,//
package: info.payment_params.package,//package
signType: info.payment_params.signType,//MD5
paySign: info.payment_params.sign,//
success:(res)=> {
this.$requst.post('order/paid',{order_coding:info.coding}).then(res=>{
if(res.code==0){
this.suseeceEv(info.coding);
} else this.$toolAll.tools.showToast(res.msg);
})
},
fail:()=> {
this.$toolAll.tools.showToast('取消支付');
setTimeout(()=>{
uni.navigateTo({
url:'/pagesA/myOrder/myOrder'
})
},2000)
}
});
} else {
this.$requst.post('order/paid',{order_coding:info.coding}).then(res=>{
if(res.code==0){
this.suseeceEv(info.coding);
} else this.$toolAll.tools.showToast(res.msg);
})
}
},
suseeceEv(coding){
uni.removeStorageSync('chooseAddress')
this.isSuccess = true;
if(this.orderList[0].cateNum==1 && this.orderList.pin_user_id!=0){
this.isfen = true;
this.$requst.post('order/get-group-id',{order_coding:coding}).then(res=>{
if(res.code==0){
this.checkGrounpId = res.data.group_id;
}
})
}
},
goThere(val){//
wx.getLocation({//
type: 'wgs84', //wx.openLocationbug: iOS 6.3.30 type wgs84
success: function (res) {
wx.openLocation({//使
latitude: getApp().globalData.latitude,//-
longitude: getApp().globalData.longitude,//-
name: val,
address: val
})
}
})
},
checkAddress(){//
this.$requst.post('user/address').then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
if(item.is_default==1) {
this.addressInfo = item;
} else {
if(res.data.length==1){
this.addressInfo = item;
}
}
})
this.userPphone = this.$toolAll.tools.hideMPhone(this.addressInfo.phone);
}
}
})
},
checkexpress(){//
if(this.isExpress) {
this.$requst.post('common/express-list').then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
if(item.is_default==1){
this.expressInfo = item;
this.expressInfo.default_price = this.expressInfo.default_price/100;
}
})
this.totalEv();
}
}
})
}
},
expressEv(index){//
if(index==0) {
this.isExpress = true;
this.checkexpress();
if(this.addressInfo==''){this.$toolAll.tools.showToast('请完善收件人信息','none',1500);}
}
if(index==1) {
this.isExpress = false;
this.expressInfo.default_price = 0;
}
},
totalEv(){//
if(this.isNei!=3) {
//
this.allPrice = this.zanAllPrice - this.youQuan.youPrice;
if(this.payType=='coin'){
this.obtainCoin(this.payFS[0].num);
}
} else {
//
this.allPrice = this.zanAllPrice;
}
this.loading = true;
},
checkOrderDetail(){//
let nsku_list = [];
this.orderList.forEach(item=>{
let obj = {
sku_coding:item.coding,
num:item.num
}
nsku_list.push(obj)
})
let parmas = {
sku_list: nsku_list,
pick_self: 0
}
this.$requst.post('order/prepare-info',parmas).then(res=>{
if(res.code==0){
this.obtainCoin(res.data.account.coin);
if(this.payType=='coin'){
this.payFS[0].num = res.data.account.coin;
} else if(this.payType=='wechat'){
} else if(this.payType=='hybrid'){
this.payFS[1].num = res.data.account.coin;
if(res.data.account.coin==0) {
this.payFS[1].isActive = false;
} else {
setTimeout(()=>{
this.chooseFS(1);
},500)
}
} else {
this.payFS[1].num = res.data.account.coin;
this.payFS[2].num = res.data.account.score;
}
} else this.$toolAll.tools.showToast(res.msg);
})
},
checkeList(isJfen){
this.allPrice = this.allPrice*1;
this.orderList.forEach(item=>{
this.allPrice += item.price*item.num;
this.allNum += item.num;
})
if(isJfen==3){//
this.zanAllPrice = this.allPrice;
} else {
this.zanAllPrice = this.$toolAll.tools.addXiaoShu(this.allPrice);
}
this.quanEv(0);//
this.totalEv();
},
quanEv(index){//
if(this.payType!='coin' && this.payType!='wechat'){
if(this.payFS[1].isActive){
// this.$toolAll.tools.showToast('使');
// this.allPrice = this.$toolAll.tools.addXiaoShu(this.zanAllPrice*1 + this.expressInfo.default_price*1);
} else {
if(index==1){
this.showQuan = true
}
this.youQuan.id = 0;
this.youQuan.youPrice = 0;
this.allPrice = (this.zanAllPrice*1 - this.expressInfo.default_price*1).toFixed(2);
this.checkQuan();//
}
}
},
checkQuan(){//
this.$requst.post('user/get-coupon-list',{status:'normal',page:this.page,size:this.size}).then(res=>{
if(res.code==0){
this.quanList = [];
if(res.data.length!=0){
res.data.forEach(item=>{
if(item.type!='taste'){//
let obj = {
id:item.id,
youPrice:item.amount/100,
manPrice:item.condition/100,
isGrade:0,
name:item.name,
startTime:item.begin_at,
endTime:item.end_at,
isStatus:false
}
this.quanList.push(obj);
}
})
}
}
})
},
chooseQuan(index){//
if(this.zanAllPrice <= this.quanList[index].manPrice){//
this.$toolAll.tools.showToast('未达到使用条件')
} else {
if(this.allPrice==0){
this.$toolAll.tools.showToast('此订单费用为 0');
// this.$requst.post('user/get-coin-price',{amount:this.quanList[index].youPrice,get_type:'coin'}).then(res=>{
// if(res.code==0){
// this.zf_kqPrice = this.zf_kqPrice - res.data.amount;
// this.showQuan = false;
// }
// })
} else {
this.quanList.forEach(item=>{
item.isStatus = false;
});
this.quanList[index].isStatus = true;
this.showQuan = false;
this.quanList[index].youPrice = this.$toolAll.tools.addXiaoShu(this.quanList[index].youPrice);
this.youQuan = this.quanList[index];
this.allPrice = this.zanAllPrice*1 - this.quanList[index].youPrice*1 + this.expressInfo.default_price*1;// = -
this.allPrice = this.allPrice.toFixed(2)*1;
}
}
},
goCoupon(){//
this.showQuan = false;
uni.navigateTo({
url:'/pagesA/coupon/coupon'
})
},
focusEv(){//
this.isFocus = true;
},
blurEv(){//
this.isFocus = false;
},
goDetail(){//
uni.navigateTo({
url:'/pagesA/myOrder/myOrder'
})
},
goShop(){//
let nurl = '';
if(this.isNei==3) nurl = '/pagesA/pointsMall/pointsMall';
else nurl = '/pages/tabbar/shop/shop';
uni.reLaunch({
url:nurl
})
}
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
</style>

View File

@ -0,0 +1,808 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'购物车'" :statusTitle="true"></status-nav>
<view v-if="loading" :style="{paddingTop: statusHeight+'px'}" class="pad-zy30" style="padding-bottom: 150rpx;">
<view class="bacf radius20 mar-s20 disjbac pad-sx27-zy20">
<view class="bold">配送方式</view>
<view class="fon26 col3 disac">
<view @tap="expressEv(1)" :class="!isExpress?'activeT':'expressT'" :style="{background:isExpress?'':publicColor}">自提</view>
<view v-if="!isVirtual" @tap="expressEv(0)" :class="isExpress?'activeT':'expressT'" :style="{background:isExpress?publicColor:''}"></view>
</view>
</view>
<!-- 地址信息 -->
<view v-if="isExpress" class="bacf radius20 mar-s20 pad-sx27-zy20">
<view class="bold">收件人信息</view>
<navigator url="/pagesA/myAddress/myAddress?isWhere=0" hover-class="none">
<view class="fon26 col3 disjbac pad-s50">
<view v-if="addressInfo!=''">
<view class="fon28 col3 bold mar-x20">{{addressInfo.name}} <span class="mar-z20">{{userPphone}}</span></view>
<view class="fon24 col9">{{addressInfo.province_str}}{{addressInfo.city_str}}{{addressInfo.county_str || ''}}{{addressInfo.address || ''}}</view>
</view>
<view v-else class="fon24 col9">请完善收件人信息</view>
<image src="/static/public/nextM.png" class="xiaDan-next" mode="aspectFill"></image>
</view>
</navigator>
</view>
<!-- 自提地址 -->
<view v-else class="bacf radius20 mar-s20 pad-sx27-zy20">
<view class="bold">自提地址</view>
<input type="number" maxlength="11" :focus="isFocus" @blur="blurEv" v-model="zPhone" class="mar-s50 mar-x20" style="border: 2rpx solid #E0E0E0;padding: 20rpx;border-radius: 10rpx;font-size: 24rpx;" placeholder="请输入收货人手机号" />
<view class="fon26 col3 disjbac">
<view>
<view class="fon28 col3 bold mar-x20">Company</view>
<view class="fon24 col9">{{goAddress}}</view>
</view>
<!-- 立即导航 -->
<image @tap="goThere(goAddress)" src="/static/public/daoh.png" class="there" mode="aspectFill"></image>
</view>
</view>
<!-- 订单信息 -->
<view class="bacf radius20 mar-s20 pad-sx27-zy20">
<view class="bold">订单信息</view>
<view v-for="(item,index) in orderList" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
<image lazy-load @tap="goShopDetail(item.id)" :src="item.imgSrc" class="flexs order-image" mode="aspectFill"></image>
<view class="width100 disjb fw" style="height: 166rpx;">
<view>
<view @tap="goShopDetail(item.id)" class="fon28 col3 bold clips2">{{item.title}}</view>
<view class="order-sy">{{item.sku_name}}</view>
</view>
<view class="disjbac mar-s10 width100">
<view class="order-item-price" v-if="isNei!=3">{{item.price}}</view>
<view class="order-item-price" v-else>{{item.price}}</view>
<view class="fon28 col6">x{{item.num}}</view>
</view>
</view>
</view>
<view class="fon28 disjbac mar-s20 pad-s10">
<view class="col6">{{allNum}}</view>
<view class="bold colf8" v-if="isNei!=3">{{zanAllPrice}}</view>
<view class="bold colf8" v-else>{{allPrice}}</view>
</view>
</view>
<!-- 选择支付方式 -->
<view class="bacf radius20 mar-s20 fon28 col3 pad-sx30 pad-zy20">
<view class="bold fon28">选择支付方式</view>
<view @tap="chooseFS(index)" v-for="(item,index) in payFS" :key="index" v-if="isCurrent!=index" class="disjbac mar-s30">
<view class="disac">
<image v-if="item.isActive" src="/static/public/chooseFS.png" class="chooseDX" mode=""></image>
<image v-else src="/static/public/cancle-FS.png" class="chooseDX" mode=""></image>
<view class="mar-z25">{{item.title}}</view>
</view>
<view v-if="item.num!=0">{{item.num}}</view>
</view>
</view>
<!-- 优惠 -->
<view v-if="isNei!=3" class="bacf radius20 mar-s20 pad-sx27-zy20">
<view class="bold">优惠</view>
<view @tap="quanEv(1)" class="fon28 col3 disjbac mar-sx40">
<view>优惠券</view>
<view class="disac">
<view class="colf8 bold">-{{youQuan.youPrice}}</view>
<image src="/static/public/nextM.png" class="xiaDan-next" mode="aspectFill"></image>
</view>
</view>
</view>
<!-- 快递费用 -->
<view v-if="isExpress" class="bacf radius20 mar-s20 disjbac pad-sx27-zy20">
<view class="bold">快递费用</view>
<view class="fon28 colf8 bold">{{expressInfo.default_price}}</view>
</view>
<view class="disjbac posixzy bacf pad-zy32" style="height: 124rpx;line-height: 124rpx;">
<!-- 去支付 -->
<view class="fon36 colf8 bold" v-if="isNei!=3">{{allPrice<0?0:allPrice}}<span v-if="isKq">+{{zf_kqPrice}}</span><span v-if="isExpress && expressInfo.default_price!=0" style="font-size: 24rpx;color: #000;">+ {{expressInfo.default_price}}</span></view>
<view class="fon40 colf8 bold dis" v-else><span class="col3 fon28">合计积分</span>{{allPrice}}<span v-if="isExpress && expressInfo.default_price!=0">+ {{expressInfo.default_price}}</span></view>
<view @tap="goPayment" v-if="isNei!=3" class="goPayment"></view>
<view @tap="isDui=true" v-else class="goPayment">去兑换</view>
</view>
</view>
<view v-if="showQuan" @tap.stop="showQuan=false" class="posAll">
<view class="bacf posixzy" style="border-radius: 40rpx 40rpx 0rpx 0rpx;" @tap.stop="showQuan=true">
<view class="pad-sx20 pad-zy50">
<view class="disjbac">
<view class="fon28 bold col3">可用优惠券({{quanList.length}})</view>
<image @tap.stop="showQuan=false" src="/static/public/cha-close.png" style="width: 30rpx;height: 30rpx;" mode="aspectFill"></image>
</view>
<!-- <view class="fon28 bold col3 disja pad-s50" style="padding-bottom: 16rpx;">
<view class="posir" :class="switchQuan?'activeQuan':''" @tap="switchQuan=true">(1)</view>
<view class="posir" :class="!switchQuan?'activeQuan':''" @tap="switchQuan=false">(0)</view>
</view> -->
<scroll-view scroll-y class="mar-s40 quan-list-box">
<view @tap.stop="chooseQuan(index)" v-for="(item,index) in quanList" :key="index" class="mar-x40">
<view class="disjbac quan-item-box">
<view class="posir">
<image class="posia" src="/static/public/quan-left.png" mode=""></image>
<view class="posir" style="z-index: 1;">
<view class="pad-s40 pad-x30 fon28"><span class="bold fon56">{{item.youPrice}}</span></view>
<view class="fon24" style="padding-left: 12rpx;">{{item.manPrice}}元可使用</view>
</view>
</view>
<view>
<!-- <view class="fon28 col3 mar-s20">{{['黄金','白银'][item.isGrade]}}会员专属优惠券</view> -->
<view class="fon28 col3 mar-s20">{{item.name}}</view>
<view>
<image v-if="item.isStatus" src="/static/public/chooseQuan.png"></image>
<image v-else src="/static/public/cancleQuan.png"></image>
</view>
<view class="fon20 col3 mar-x20">有效期{{item.startTime.slice(0,10)}}{{item.endTime.slice(0,10)}}</view>
</view>
</view>
</view>
</scroll-view>
<!-- 领取优惠券按钮 -->
<view @tap.stop="goCoupon" class="ling-btn">领取优惠券</view>
</view>
</view>
</view>
<!-- 确认兑换弹框 -->
<view v-if="isDui" @tap.stop="isDui=false" class="posAll zhun-dui-box">
<view class="bacf radius20 width100 tc fon28 col3 pad20" @tap.stop="isDui=true">
<view class="bold" style="margin: 0rpx 0 56rpx 0;">兑换商品</view>
<view style="margin: 0rpx 0 66rpx 0;">您确定使用{{allPrice}}积分兑换吗</view>
<view class="disjbac mar-x20 pad-zy20 zhun-dui-btn">
<view @tap.stop="isDui=false">暂不兑换</view>
<view @tap.stop="goPayment">立即兑换</view>
</view>
</view>
</view>
<!-- 支付成功 -->
<view v-if="isSuccess" class="posAll" :style="{top:statusHeight+'px'}" style="z-index: 3;background-color: #F5F5F5;">
<view class="bacf radius20 mar-s20 mar-zy20 success-box">
<image src="/static/public/pay-success.png" mode=""></image>
<view class="fon28 col3 pad-s20 pad-x40">支付成功</view>
<view class="success-hj"><span v-if="isNei!=3">{{jsPrice<0?0:jsPrice}}</span><span v-else>{{jsPrice}}</span></view>
<view class="disja success-btn">
<view @tap="goDetail"></view>
<view @tap="goShop" class="colf" :style="{background:publicColor}">再逛一逛</view>
</view>
</view>
</view>
<!-- 分享弹框 -->
<view v-if="isfen" class="posAll disjcac" style="background-color: rgba(0,0,0,.25);z-index: 8;">
<view class="bacf width100 radius20 posir" style="padding: 60rpx 50rpx;margin: 0 70rpx;text-align: center;">
<image @tap="isfen=false" src="../../static/public/closequan.png" class="posia heyan-close" mode=""></image>
<view style="color: #f55255;font-size: 36rpx;">立即完成拼单?</view>
<view style="margin: 50rpx 0;font-size: 26rpx;">点击下方分享给朋友完成拼单</view>
<view class="posir radius15 disjcac pad-sx20" style="background-color: #22cc3e;color: #FFFFFF;font-size: 36rpx;">
分享给朋友
<button open-type="share" class="posia-op">分享给朋友</button>
</view>
</view>
</view>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
isExpress:false,
switchQuan:true,
showQuan:false,//
isDui:false,
orderList:uni.getStorageSync('orderList'),
quanList:[],
goAddress:'四川省成都市成华区双店路B口',
youQuan:{
id:0,
youPrice:0
},//
allPrice:0,//
allNum:0,//
zanAllPrice:0,//
isNei:0,
expressInfo:{},//
addressInfo:'',//
userPphone:'请完善信息',
zPhone:'',//
page:1,
size:10,
isFocus:false,
loading:false,
zf_allPrice:0,//
zf_kqPrice:0,//
payFS:[
{title:'微信支付',isActive:true,num:0},
{title:'孔雀币',isActive:false,num:100},
{title:'积分',isActive:false,num:100},
],
isKq:false,
jsPrice:0,//,
zc_allPrice:0,//
coin_price:0,//
isSuccess:false,//
ntype:'money',//money coin
times:0,//
isCurrent:2,
isfen:false,
checkGrounpId:0,
expressInfo:{
default_price:0
},
isVirtual:false,//
payType:''// wechat=;coin=;hybrid=
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onShareAppMessage(res) {
var shareObj = {
     title: this.orderList[0].title, // (slogan)
     path: `/pagesB/shopDetail/shopDetail?id=${this.orderList[0].id}&category_id=0&is_activity=${this.orderList[0].is_activity}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
     imageUrl: this.orderList[0].imgSrc//PNGJPG imageUrl 使 5:4
  };
  return shareObj;
//   return false;
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
this.checkChoose();//
uni.removeStorageSync('orderInfo');
},
onLoad(options) {
// wechat=;coin=;hybrid=
this.payType = uni.getStorageSync('payType');
// this.payType = 'coin';
if(this.payType=='wechat') {
this.payFS = [{title:'微信支付',isActive:true,num:0}]
} else if(this.payType=='coin'){
this.payFS = [{title:'孔雀币',isActive:true,num:0}]
} else if(this.payType=='hybrid'){
this.payFS = [
{title:'微信支付',isActive:true,num:0},
{title:'孔雀币',isActive:false,num:0}
]
}
//
this.zPhone = uni.getStorageSync('phone');
//
options.isVirtual == "virtual" ? this.isVirtual = true : this.isVirtual = false
this.checkexpress();//
this.checkeList(options.isNei);//
this.checkOrderDetail();//
this.isNei = options.isNei;
if(this.isNei==3) {
this.payFS[0].isActive = false;
this.payFS[2].isActive = true;
this.isCurrent = 1;
}
},
methods: {
checkChoose(){
if(uni.getStorageSync('chooseAddress')==''){
this.checkAddress();//
} else {
let naddress = uni.getStorageSync('chooseAddress');
this.addressInfo = {
id:naddress.id,
name:naddress.userName,
phone:naddress.userPhone,
province_str:naddress.province,
city_str:naddress.city,
county_str:naddress.county,
address:naddress.address
}
this.userPphone = this.$toolAll.tools.hideMPhone(naddress.userPhone);
}
},
obtainCoin(coinNum){//
this.$requst.post('user/get-coin-price',{amount:coinNum,get_type:this.ntype}).then(res=>{
if(res.code==0){
if(this.ntype=='money'){
this.coin_price = res.data.amount/100;
if(this.payType=='coin'){
//
if(this.zanAllPrice - this.coin_price<=0){//
this.allPrice = 0;
this.zf_kqPrice = this.zanAllPrice*1;
} else {//
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
this.zf_kqPrice = this.coin_price;
}
this.isKq = true;
}
} else {
this.zf_kqPrice = res.data.amount;
this.isKq = true;
}
}
})
},
goShopDetail(id){
uni.navigateTo({
url:`/pagesB/shopDetail/shopDetail?id=${id}`
})
},
chooseFS(index){
this.payFS[index].isActive = !this.payFS[index].isActive;
if(this.isNei==3){//
if(!this.payFS[0].isActive && !this.payFS[2].isActive){
this.$toolAll.tools.showToast('请选择支付方式');
this.allPrice = this.zanAllPrice;
this.isKq = false;
return;
}
} else {//
if(this.payType!='coin'){
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
this.$toolAll.tools.showToast('请选择支付方式')
this.allPrice = this.zanAllPrice;
this.isKq = false;
this.zf_kqPrice = this.payFS[1].num;
return;
}
}
}
if(this.payFS[index].title=='微信支付'){
if(this.isNei!=3){
//+
if(this.payFS[0].isActive && this.payFS[1].isActive){
if(this.zanAllPrice - this.coin_price >=0){//
this.allPrice = this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price);
this.zf_kqPrice = this.payFS[1].num;
} else {//
this.allPrice = 0;
this.ntype = 'coin';
this.obtainCoin(this.zanAllPrice*100);
}
return;
}
//+
if(!this.payFS[0].isActive && this.payFS[1].isActive){
if(this.zanAllPrice - this.coin_price>0){
this.$toolAll.tools.showToast('孔雀币不足');
}
return;
}
//+
if(this.payFS[0].isActive && !this.payFS[1].isActive){
this.isKq = false;
this.zf_kqPrice = 0;
return;
}
} else {
if(this.expressInfo.default_price==0){
this.$toolAll.tools.showToast('暂不可微信支付');
this.payFS[index].isActive = false;
}
}
}
if(this.payFS[index].title=='孔雀币') {
if(this.payType!='coin'){
if(this.youQuan.youPrice!=0){
this.payFS[1].isActive = false;
this.$toolAll.tools.showToast('无法使用孔雀币支付');
} else {
if(this.coin_price!=0){
//+
if(this.payFS[0].isActive && this.payFS[1].isActive) {
if(this.zanAllPrice - this.coin_price<=0){//
this.ntype = 'coin';
this.obtainCoin(this.zanAllPrice*100);
this.allPrice = 0;
} else {//
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
this.zf_kqPrice = this.payFS[1].num;
}
return;
}
//+
if(this.payFS[0].isActive && !this.payFS[1].isActive) {
this.isKq = false;
this.zf_kqPrice = 0;
// 0
if(this.youQuan.youPrice==0){
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice)*1).toFixed(2);
} else {
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.youQuan.youPrice)*1).toFixed(2);
}
return;
}
//+
if(!this.payFS[0].isActive && this.payFS[1].isActive){
if(this.zanAllPrice - this.coin_price<=0){//
this.ntype = 'coin'
this.obtainCoin(this.allPrice*100);
this.allPrice = 0;
}
if(this.zanAllPrice - this.coin_price>0){//
this.$toolAll.tools.showToast('孔雀币不足')
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
this.zf_kqPrice = this.payFS[1].num;
}
return;
}
//+
if(!this.payFS[0].isActive && !this.payFS[1].isActive){
this.isKq = false;
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice)*1).toFixed(2);
return;
}
} else {
this.$toolAll.tools.showToast('暂无可用孔雀币');
this.payFS[index].isActive = false;
}
}
} else {
if(!this.payFS[index].isActive) {
this.isKq = false;
this.zf_kqPrice = 0;
this.allPrice = this.zanAllPrice;
} else {
//
if(this.zanAllPrice - this.coin_price<=0){//
this.ntype = 'coin';
this.obtainCoin(this.zanAllPrice*100);
this.allPrice = 0;
} else {//
this.allPrice = (this.$toolAll.tools.addXiaoShu(this.zanAllPrice - this.coin_price)*1).toFixed(2);
this.zf_kqPrice = this.payFS[0].num;
}
}
}
}
},
goPayment(){//
this.isFocus = false;
this.isDui = false;
let nphone = '';
if(this.isExpress) {
nphone = this.addressInfo.phone;//
} else nphone = this.zPhone;//
let self = 0;//
if(!this.isExpress) self = 1;//
let nsku_list = [];
let is_only = 0;
this.orderList.forEach(item=>{
let obj = {
sku_coding:item.coding,
num:item.num,
group_id:item.pin_user_id
}
nsku_list.push(obj);
is_only = item.is_only;
})
let is_score = 0;
if(this.isNei == 3) {is_score = 1}
if(this.zf_kqPrice!=0) {
this.jsPrice = `${this.allPrice} +${this.zf_kqPrice}孔雀币`;
} else {
this.jsPrice = this.allPrice;
}
let parmas = {
sku_list: nsku_list,//
total: this.allPrice*100,//
address_id: this.addressInfo.id || 0,//ID
express_code: this.expressInfo.code || 0,//
coupon_id: this.youQuan.id,//ID
coupon_price: this.youQuan.youPrice*100,//
pick_self: self,//0 1
pick_self_phone: nphone,//
original_total: this.zanAllPrice*100,//
freight: this.expressInfo.default_price || 0,//
remarks: "",//
is_only:is_only,//0 12
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.expressInfo.default_price!=undefined && !this.payFS[0].isActive){//
this.$toolAll.tools.showToast('请添加微信支付方式');
} else if(this.isNei != 3 && !this.payFS[0].isActive && !this.payFS[1].isActive){
this.$toolAll.tools.showToast('请选择支付方式')
} else if(this.payType=='coin' && this.allPrice*1 > this.coin_price*1){
this.$toolAll.tools.showToast('孔雀币不足');
} else if(this.payType=='hybrid' && 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:`${getApp().globalData.hostApi}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,'none',3000);
this.times = 0;
}
}
})
}
}
},
payment(info){
if(info.needPay){
uni.requestPayment({
provider: 'wxpay',
appId:info.payment_params.appId,//appId
timeStamp: info.payment_params.timeStamp,//
nonceStr: info.payment_params.nonceStr,//
package: info.payment_params.package,//package
signType: info.payment_params.signType,//MD5
paySign: info.payment_params.sign,//
success:(res)=> {
this.$requst.post('order/paid',{order_coding:info.coding}).then(res=>{
if(res.code==0){
this.suseeceEv(info.coding);
} else this.$toolAll.tools.showToast(res.msg);
})
},
fail:()=> {
this.$toolAll.tools.showToast('取消支付');
setTimeout(()=>{
uni.navigateTo({
url:'/pagesA/myOrder/myOrder'
})
},2000)
}
});
} else {
this.$requst.post('order/paid',{order_coding:info.coding}).then(res=>{
if(res.code==0){
this.suseeceEv(info.coding);
} else this.$toolAll.tools.showToast(res.msg);
})
}
},
suseeceEv(coding){
uni.removeStorageSync('chooseAddress')
this.isSuccess = true;
if(this.orderList[0].cateNum==1 && this.orderList.pin_user_id!=0){
this.isfen = true;
this.$requst.post('order/get-group-id',{order_coding:coding}).then(res=>{
if(res.code==0){
this.checkGrounpId = res.data.group_id;
}
})
}
},
goThere(val){//
wx.getLocation({//
type: 'wgs84', //wx.openLocationbug: iOS 6.3.30 type wgs84
success: function (res) {
wx.openLocation({//使
latitude: getApp().globalData.latitude,//-
longitude: getApp().globalData.longitude,//-
name: val,
address: val
})
}
})
},
checkAddress(){//
this.$requst.post('user/address').then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
if(item.is_default==1) {
this.addressInfo = item;
} else {
if(res.data.length==1){
this.addressInfo = item;
}
}
})
this.userPphone = this.$toolAll.tools.hideMPhone(this.addressInfo.phone);
}
}
})
},
checkexpress(){//
if(this.isExpress) {
this.$requst.post('common/express-list').then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
if(item.is_default==1){
this.expressInfo = item;
this.expressInfo.default_price = this.expressInfo.default_price/100;
}
})
this.totalEv();
}
}
})
}
},
expressEv(index){//
if(index==0) {
this.isExpress = true;
this.checkexpress();
if(this.addressInfo==''){this.$toolAll.tools.showToast('请完善收件人信息','none',1500);}
}
if(index==1) {
this.isExpress = false;
this.expressInfo.default_price = 0;
}
},
totalEv(){//
if(this.isNei!=3) {
//
this.allPrice = this.zanAllPrice - this.youQuan.youPrice;
if(this.payType=='coin'){
this.obtainCoin(this.payFS[0].num);
}
} else {
//
this.allPrice = this.zanAllPrice;
}
this.loading = true;
},
checkOrderDetail(){//
let nsku_list = [];
this.orderList.forEach(item=>{
let obj = {
sku_coding:item.coding,
num:item.num
}
nsku_list.push(obj)
})
let parmas = {
sku_list: nsku_list,
pick_self: 0
}
this.$requst.post('order/prepare-info',parmas).then(res=>{
if(res.code==0){
this.obtainCoin(res.data.account.coin);
if(this.payType=='coin'){
this.payFS[0].num = res.data.account.coin;
} else if(this.payType=='wechat'){
} else {
this.payFS[1].num = res.data.account.coin;
this.payFS[2].num = res.data.account.score;
}
} else this.$toolAll.tools.showToast(res.msg);
})
},
checkeList(isJfen){
this.allPrice = this.allPrice*1;
this.orderList.forEach(item=>{
this.allPrice += item.price*item.num;
this.allNum += item.num;
})
if(isJfen==3){//
this.zanAllPrice = this.allPrice;
} else {
this.zanAllPrice = this.$toolAll.tools.addXiaoShu(this.allPrice);
}
this.quanEv(0);//
this.totalEv();
},
quanEv(index){//
if(this.payType!='coin' && this.payType!='wechat'){
if(this.payFS[1].isActive){
this.$toolAll.tools.showToast('无法使用优惠券减免');
// this.allPrice = this.$toolAll.tools.addXiaoShu(this.zanAllPrice*1 + this.expressInfo.default_price*1);
} else {
if(index==1){
this.showQuan = true
}
this.youQuan.id = 0;
this.youQuan.youPrice = 0;
this.allPrice = (this.zanAllPrice*1 - this.expressInfo.default_price*1).toFixed(2);
this.checkQuan();//
}
}
},
checkQuan(){//
this.$requst.post('user/get-coupon-list',{status:'normal',page:this.page,size:this.size}).then(res=>{
if(res.code==0){
this.quanList = [];
if(res.data.length!=0){
res.data.forEach(item=>{
if(item.type!='taste'){//
let obj = {
id:item.id,
youPrice:item.amount/100,
manPrice:item.condition/100,
isGrade:0,
name:item.name,
startTime:item.begin_at,
endTime:item.end_at,
isStatus:false
}
this.quanList.push(obj);
}
})
}
}
})
},
chooseQuan(index){//
if(this.zanAllPrice <= this.quanList[index].manPrice){//
this.$toolAll.tools.showToast('未达到使用条件')
} else {
if(this.allPrice==0){
this.$toolAll.tools.showToast('此订单费用为 0');
// this.$requst.post('user/get-coin-price',{amount:this.quanList[index].youPrice,get_type:'coin'}).then(res=>{
// if(res.code==0){
// this.zf_kqPrice = this.zf_kqPrice - res.data.amount;
// this.showQuan = false;
// }
// })
} else {
this.quanList.forEach(item=>{
item.isStatus = false;
});
this.quanList[index].isStatus = true;
this.showQuan = false;
this.quanList[index].youPrice = this.$toolAll.tools.addXiaoShu(this.quanList[index].youPrice);
this.youQuan = this.quanList[index];
this.allPrice = this.zanAllPrice*1 - this.quanList[index].youPrice*1 + this.expressInfo.default_price*1;// = -
this.allPrice = this.allPrice.toFixed(2)*1;
}
}
},
goCoupon(){//
this.showQuan = false;
uni.navigateTo({
url:'/pagesA/coupon/coupon'
})
},
focusEv(){//
this.isFocus = true;
},
blurEv(){//
this.isFocus = false;
},
goDetail(){//
uni.navigateTo({
url:'/pagesA/myOrder/myOrder'
})
},
goShop(){//
let nurl = '';
if(this.isNei==3) nurl = '/pagesA/pointsMall/pointsMall';
else nurl = '/pages/tabbar/shop/shop';
uni.reLaunch({
url:nurl
})
}
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
</style>

View File

@ -0,0 +1,147 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'积分管理'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy30 fon28 col3">
<view class="mar-s20 bacf pad20 radius20 bold">
<view class="mar-x30">当前积分</view>
<view style="font-size: 56rpx;">{{dangScore}}</view>
</view>
<view class="mar-s20 disjbac">
<view class="disjbac pad20 bacf radius20 width48" style="box-sizing: border-box;">
<image src="../../static/public/integral-01-108.png" class="score-img" mode=""></image>
<view class="width100 score-people-box">
<view class="font4">我的分享人</view>
<view class="fon36 bold">{{sharePeople}}<span class="fon26 font4"></span></view>
</view>
</view>
<view class="disjbac pad20 bacf radius20" style="box-sizing: border-box;">
<image src="../../static/public/integral-02-108.png" class="score-img" mode=""></image>
<view class="width100 score-people-box">
<view class="font4">签到记录</view>
<view @tap="goSigin" class="score-sigin-btn">立即签到</view>
</view>
</view>
</view>
<!-- 积分列表消费列表 -->
<view class="mar-s20 bacf pad20 radius20">
<view class="mar-x50 fon28 disja">
<view @tap="switchState(true)" :class="activeJF?'col3 bold':'col9'">积分列表</view>
<view @tap="switchState(false)" :class="!activeJF?'col3 bold':'col9'">消费列表</view>
</view>
<!-- 积分列表 -->
<block v-if="dataList.length!=0">
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
<view>
<view class="fon26 col3">{{item.title}}</view>
<view class="mar-s10 fon20 col9">{{item.time}}</view>
</view>
<view v-show="activeJF" class="fon36 bold pcol">+{{item.num}}</view>
<view v-show="!activeJF" class="fon36 bold">{{item.num}}</view>
</view>
</block>
<view v-if="isHave" class="disjcac fon24 col9 bold"></view>
</view>
<!-- 分享按钮 -->
<view class="disjcac score-share-box">
<image src="/static/public/bottom-shear.png" mode=""></image>
<view class="fon40 colf bold mar-z10">分享给好友</view>
<button class="posia-op" open-type="share"></button>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
activeJF:true,
dataList:[
// {title:'',time:'2021.09.06 10:30:10',num:'1'},
// {title:'',time:'2021.09.06 10:30:10',num:'1'},
// {title:'',time:'2021.09.06 10:30:10',num:'1'},
// {title:'',time:'2021.09.06 10:30:10',num:'1'},
],
dangScore:0,//
sharePeople:0,//
page:1,
size:10,
total:0,
isZanw:true,
ntype:'in',
isHave:false,
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
}
},
onReachBottom() {
if(this.total!=this.dataList.length){
this.page++
this.checkList(this.ntype)//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多记录','none',1000)
this.isZanw = false
}
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
},
onLoad(options) {
this.checkInfo();
this.checkList();
},
methods: {
checkList(){//
this.$requst.post('user/score-log',{page:this.page,size:this.size,type:this.ntype}).then(res=>{
if(res.code==0){
if(this.page==1) this.dataList = [];
this.total = res.data.total;
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let obj = {
title:item.name,
time:item.created_at,
num:item.num
}
this.dataList.push(obj);
})
}
if(this.dataList.length==0)this.isHave = true;
}
})
},
checkInfo(){//
this.$requst.post('user/score-load').then(res=>{
if(res.code==0){
this.dangScore = res.data.score;
this.sharePeople = res.data.share.total;
}
})
},
switchState(flag){//
this.dataList = [];
this.activeJF = flag;
this.page =1;
this.isZanw = true;
if(flag) {
this.ntype ='in';
this.checkList(this.ntype);
} else {
this.ntype ='out';
this.checkList(this.ntype);
}
},
goSigin(){
uni.navigateTo({url:'/pagesA/signIn/signIn'})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,158 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'自主预约'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view v-if="isLoading" :style="{paddingTop: statusHeight+'px'}" class="pad-zy30" style="padding-bottom: 160rpx;">
<view v-if="dataList.length!=0" class="mar-s30 bacf pad20" v-for="(item,index) in dataList" :key="index" style="border-radius: 28rpx;">
<view class="disjbac">
<view class="disac">
<image class="radius20 mar-y20 flexs" src="/static/public/logo.png" style="width: 98rpx;height: 98rpx;" mode=""></image>
<view>
<view class="fon36 col3 bold clips1">{{item.name}}</view>
<view class="fon24 col3 mar-s10">{{item.content}}</view>
</view>
</view>
<view :style="{background:[ingColor,publicColor,failColor,failColor,failColor][item.status]}" class="fon24 colf radius10 flexs" style="padding: 14rpx 24rpx;">{{['审核中...','预约成功','预约失败','预约取消','预约完成'][item.status]}}</view>
</view>
<view class="mar-s36 fon24 col3">预约时间{{item.yuTime}}</view>
<view class="disjbac fon24 col3 mar-s30">
<!-- <view>联系人{{item.lname}}</view> -->
<view>联系电话{{item.lphone}}</view>
</view>
<view @tap="quyuy(index)" class="disjcac mar-s40 width100 colf fon30 radius10 posir" :style="{background:[quColor,quColor,publicColor,publicColor,publicColor][item.status]}" style="height: 90rpx;line-height: 90rpx;">
{{['取消预约','取消预约','重新预约','再次预约','再次预约'][item.status]}}
<!-- <button :disabled="(item.status==2 || item.status==3 || item.status==4)?true:false" class="posia"
style="top: 0;left: 0;right: 0;bottom: 0;background-color: #000000;opacity: 0;">{{['取消预约','取消预约','重新预约','再次预约','再次预约'][item.status]}}</button> -->
</view>
</view>
<nothing-page v-if="dataList.length==0" :content="'暂无更多预约内容'"></nothing-page>
</view>
<!-- 底部按钮 -->
<view class="posixzy bacf pad-sx25">
<view @tap="goYu" class="fon30 radius20 tc colf bold" style="margin: 0 83rpx;height: 90rpx;line-height: 90rpx;" :style="{background:publicColor}">我要预约</view>
</view>
<!-- 弹框 -->
<pu-po :isShowT="isShowT" :contentVal="'是否取消当前预约?'" :clearVal="'否'" :comfrimVal="'是'" @comfirmev="comfirmev" @cancleev="isShowT=false"></pu-po>
<!-- 底部客服 -->
<public-customer></public-customer>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
failColor:'#CCCCCC',//
ingColor:'#FFBE4D',//
quColor:'#FF4D4D',//
dataList:[
// {status:0,imgSrc:'',name:'',content:'',yuTime:'20210708 14:3015:30',lname:'',lphone:'18888888888'},
// {status:1,imgSrc:'',name:'',content:'',yuTime:'20210708 14:3015:30',lname:'',lphone:'18888888888'},
// {status:2,imgSrc:'',name:'',content:'',yuTime:'20210708 14:3015:30',lname:'',lphone:'18888888888'},
],
btnCon:'取消预约',///
page:1,
size:20,
total:'',//
isZanw:true,
isLoading:false,
isShowT:false,
zzId:''//ID
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onReachBottom() {
if(this.total!=this.dataList.length){
this.page++
this.checkPoint()//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多预约记录','none',1000)
this.isZanw = false
}
},
onShow() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.$toolAll.tools.showToast('加载中...','loading')
this.checkPoint()//
}
},
methods: {
checkPoint(){//
this.$requst.post('user/appointment-list',{page:this.page,size:this.size}).then(res=>{
// console.log('',res);
if(res.code==0){
if(this.page==1) this.dataList = []
if(res.data.list.length!=0){
this.total = res.data.total
res.data.list.forEach(item=>{
let timeStr = item.appointment_at.slice(0,10).split('-')
let timeZui = item.period.name.split('-')
let newStatus = ''
if(item.status_text=='审核中') newStatus = 0
if(item.status_text=='预约成功') newStatus = 1
if(item.status_text=='预约失败') newStatus = 2
if(item.status_text=='预约取消') newStatus = 3
if(item.status_text=='预约完成') newStatus = 4
let obj = {
id:item.id,
status:newStatus,
imgSrc: uni.getStorageSync('userLogo'),//token,
name:item.name,
content:item.typeInfo.title,
yuTime:`${timeStr[0]}${timeStr[1]}${timeStr[2]}${timeZui[0]}${timeZui[1]}`,
lname:item.name,
lphone:item.phone
}
this.dataList.push(obj)
})
}
this.isLoading = true
}
},error=>{})
},
goYu(){//
uni.navigateTo({
url:'/pagesA/ppointmentEv/ppointmentEv'
})
},
quyuy(index){//
if(this.dataList[index].status==0 || this.dataList[index].status==1){
this.zzId = this.dataList[index].id
this.isShowT = true
} else {
uni.navigateTo({
url:'/pagesA/ppointmentEv/ppointmentEv'
})
}
},
comfirmev(){
this.isShowT = false
this.$requst.post('user/appointment-cancel',{appointment_id:this.zzId}).then(res=>{
// console.log('',res);
if(res.code==0){
this.$toolAll.tools.showToast('取消预约成功')
setTimeout(()=>{
this.checkPoint()
},1500)
}
},error=>{})
}
}
}
</script>
<style>
</style>

142
pagesA/member/member.vue Normal file
View File

@ -0,0 +1,142 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :backgroudColor="publicColor" :tabcolor="publicColor" :statusTitle="true" :backColor="1"></status-nav>
<image src="/static/public/member-head.png" style="position: absolute;top: 0;left: 0;right: 0;height: 436rpx;width: 100%;"></image>
<view class="mar-zy32 posir" :style="{paddingTop:statusHeight+26+'px'}">
<view class="radius30 posir gao mar-zy40 fon24 pad-x20" style="box-shadow: 0px 16rpx 30rpx rgba(141, 141, 141, 0.26);">
<view class="posir pad-zy20" style="z-index: 2;">
<view class="disjb">
<view class="disac">
<!-- 头像 -->
<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">{{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;">还差{{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>
</view>
<!-- 功能列表 -->
<view class="bacf radius20 mar-s20">
<view v-if="levelInfo.level.name!='普通会员'" class="disac fon28 fw pad-x20" style="color: #C27417;">
<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>
</view>
</view>
</view>
</view>
<!-- 当前权益介绍 -->
<view class="bacf radius20 mar-s20 pad20">
<view class="mar-x30 fon32 bold" style="color: #C27417;">当前权益介绍</view>
<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>
<scoreList :dataList="dataList"></scoreList>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import scoreList from '@/components/score-list.vue';
export default {
components:{
scoreList
},
data() {
return {
huiList:[
{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:[],
levelInfo:{},
detailInfo:'',//
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkList();
this.checkInfo();
}
},
methods: {
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)
}
})
},
checkList(){//
let params = {
keyword:'',//
page:1,
size:10,
type:'normal',//type=normal newest=
sort_field:'',// score= num=
sort_value:''// asc= desc=
}
this.$requst.post('spu/score',params).then(res=>{
if(res.code==0){
this.dataList = [];
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let obj = {
id:item.id,
imgSrc: this.$http + item.cover,
saleable:item.saleable,//
stock:item.stock,//
title: item.name,
zhePrice:item.price,
yuanPrice:item.original_price,
integral:item.score,
isTuan:false,
isPing:false,
isXian:false,
isIntegral:true,
grade:item.level_id,
published_at:item.published_at,//
amount:item.amount,//
level_text:item.level_text//
}
this.dataList.push(obj)
})
} else {
this.$toolAll.tools.showToast('暂无更多积分商品')
}
}
})
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,289 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'写日记'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy20">
<view class="mar-s30 bacf pad20" style="border-radius: 20rpx 20rpx 0 0;">
<!-- 日记标题 -->
<view class="disac mar-s20">
<view class="mar-y20 flexs titlel2">日记标题</view>
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
<input v-model="diary_title" class="fon28 height-68" type="text" value="" placeholder="今天是2021年的最后一天" placeholder-style="color:#999999;"/>
</view>
</view>
<!-- 详细内容 -->
<view class="dis mar-s20">
<view class="mar-y20 flexs mar-s20 titlel2">详细内容</view>
<view class="width100 radius10 pad20 borbot-cc" style="height: 300rpx;">
<textarea v-model="diary_content" class="fon28" maxlength="500" style="height: 300rpx;width: auto;" placeholder="请输入详细内容" placeholder-style="color:#999999;"/>
<!-- <editor id="editor" class="ql-container" :placeholder="placeholder" @ready="onEditorReady"></editor> -->
</view>
</view>
<!-- 选择病种 -->
<view class="disac pad-s32">
<view class="flexs mar-y20 titlel2">选择病种</view>
<!-- 下拉列表 -->
<view @tap="openXial(0)" class="disjbac width100 radius10 pad-zy20 xiala posir">
<view>{{disease}}</view>
<image :class="isdisease?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<view v-if="isdisease" class="posia bacf radius10 xial-box mar-s20">
<view class="pad-zy20 xial-item-box">
<view @tap="chooseXia(indexl,0)" :class="diseaseCurrent==indexl?'pcol':''" v-for="(iteml,indexl) in diseaseArr" :key="indexl">{{iteml.title}}</view>
</view>
</view>
</view>
</view>
<!-- 关联医生 -->
<view class="disac pad-s32">
<view class="flexs mar-y20 titlel2">关联医生</view>
<!-- 下拉列表 -->
<view @tap="openXial(1)" class="disjbac width100 radius10 pad-zy20 xiala posir">
<view>{{diary_doctor}}</view>
<image :class="isdiary_doctor?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<view v-if="isdiary_doctor" class="posia bacf radius10 xial-box mar-s20">
<view class="pad-zy20 xial-item-box">
<view @tap="chooseXia(indexl,1)" :class="diary_doctorCurrent==indexl?'pcol':''" v-for="(iteml,indexl) in diary_doctorArr" :key="indexl">{{iteml.title}}</view>
</view>
</view>
</view>
</view>
<!-- 添加封面 -->
<view class="dis mar-s20">
<view class="mar-y20 flexs titlel2">添加封面</view>
<view class="width100">
<view v-if="fengImg!=''" class="posir" style="width: 32%;">
<image :src="fengImg" class="diary-item-img" style="width: 100%;" mode="aspectFill"></image>
<image @tap="clearfengImg" src="../../static/public/closequan.png" class="posia" style="width: 20px;height: 20px;right: 10rpx;top: 10rpx;" mode=""></image>
</view>
<image v-else @tap="updataImg(0)" class="diary-item-img" src="../../static/public/diary-add.png" mode="aspectFill"></image>
</view>
</view>
<!-- 添加图片 -->
<view class="dis mar-s20">
<view class="mar-y20 flexs titlel2">添加图片</view>
<view class="width100 disac fw">
<view v-for="(item,index) in imgArr" :key="index" class="diary-item-img posir">
<image :src="item" mode="aspectFill" class="addImg"></image>
<image @tap="clearaddImg(index)" src="../../static/public/closequan.png" class="posia" style="width: 20px;height: 20px;right: 10rpx;top: 10rpx;" mode=""></image>
</view>
<image v-if="imgArr.length!=9" @tap="updataImg(1)" class="diary-item-img" src="../../static/public/diary-add.png" mode="aspectFill"></image>
</view>
</view>
<!-- 底部按钮 -->
<view style="margin-top: 87rpx;margin-bottom: 30rpx;">
<view @tap="submit" class="fon30 radius20 tc colf bold" style="margin: 0 83rpx;height: 90rpx;line-height: 90rpx;" :style="{background:publicColor}">立即提交</view>
</view>
</view>
</view>
<!-- 底部客服 -->
<public-customer></public-customer>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import {base64ToPath} from '@/jsFile/base64-src.js';
import {checkBanner} from '@/jsFile/publicAPI.js';
export default {
data() {
return {
optionObj:'',
diary_title:'',//
diary_content:'',//
disease:'请选择病种',//
disease_id:'',//id
isdisease:false,
diseaseArr:[],
diseaseCurrent:0,
diary_doctor:'请选择关联医生',//
diary_doctor_id:'',//id
isdiary_doctor:false,
diary_doctorArr:[],
diary_doctorCurrent:0,
fengImg:'',
imgArr:[],
placeholder: '开始输入...'
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
//
if(options.id!=undefined){
this.checkDiaryInfo(options.id);
}
this.diseaseEv();
this.chooseEv();
}
},
methods: {
onEditorReady() {
// #ifdef MP-BAIDU
this.editorCtx = requireDynamicLib('editorLib').createEditorContext('editorId');
// #endif
// #ifdef APP-PLUS || H5 ||MP-WEIXIN
uni.createSelectorQuery().select('#editor').context((res) => {
this.editorCtx = res.context
}).exec()
// #endif
},
openXial(index){
if(index==0) {
this.isdisease = !this.isdisease
}
if(index==1) {
this.isdiary_doctor = !this.isdiary_doctor
}
},
chooseXia(index,num){//
if(num==0){
this.diseaseCurrent = index
this.disease = this.diseaseArr[index].title
this.disease_id = this.diseaseArr[index].id
} else {
this.diary_doctorCurrent = index
this.diary_doctor = this.diary_doctorArr[index].title
this.diary_doctor_id = this.diary_doctorArr[index].id
}
},
//
diseaseEv(){
this.$requst.post('archives/disease').then(res=>{
// console.log('',res);
if(res.code==0 && res.data.length!=0){
this.diseaseArr=[]
res.data.forEach(item=>{
let obj = {
id:item.id,
title:item.name,
pid:item.pid,
sort:item.sort
}
this.diseaseArr.push(obj)
})
// this.disease = this.diseaseArr[0].title;
// this.disease_id = this.diseaseArr[0].id;
}
},error=>{})
},
chooseEv(){//
this.$requst.post('user/doctor-list',{page:1,size:1000}).then(res=>{
if(res.code==0){
this.diary_doctorArr = [];
if(res.data.list.length){
res.data.list.forEach(item=>{
let obj = {
id:item.id,
title:item.name
}
this.diary_doctorArr.push(obj)
})
// this.diary_doctor = this.diary_doctorArr[0].title
// this.diary_doctor_id = this.diary_doctorArr[0].id
} else this.$toolAll.tools.showToast('暂无医生可选');
} else this.$toolAll.tools.showToast(res.msg);
})
},
//
updataImg(index){
if(index==0){
uni.chooseImage({
count:1,
sourceType:['album'],
success: (res) => {
let tempImg = res.tempFilePaths[0];
this.$requst.upload('file/upload/image',{file:tempImg}).then(res=>{
this.fengImg = this.$http + res.data.src;
this.$toolAll.tools.showToast('图片上传成功(*^▽^*)')
},error=>{})
}
})
} else {
uni.chooseImage({
count:9,
sourceType:['album'],
success: (res) => {
let tempImg = res.tempFilePaths;
let num = 0;
for (var i = 0; i < tempImg.length; i++) {
num++;
this.$requst.upload('file/upload/image',{file:tempImg[i]}).then(res=>{
if(this.imgArr.length!=9){
this.imgArr.push(this.$http + res.data.src);
}
if(num==tempImg.length){
this.$toolAll.tools.showToast('上传成功(*^▽^*)')
} else {
this.$toolAll.tools.showToast('上传中...')
}
},error=>{})
}
}
})
}
},
clearfengImg(){
this.fengImg = '';
},
clearaddImg(index){
this.imgArr.splice(index,1);
},
//
submit(){
if(this.diary_title==''){
this.$toolAll.tools.showToast('请输入日记标题');
} else if(this.diary_content==''){
this.$toolAll.tools.showToast('请输入详细内容');
} else if(this.disease_id==''){
this.$toolAll.tools.showToast('请选择病种');
} else if(this.diary_doctor_id==''){
this.$toolAll.tools.showToast('请关联医生');
} else if(this.fengImg==''){
this.$toolAll.tools.showToast('请添加封面图');
} else {
let params = {
title :this.diary_title,
images:this.imgArr.join(','),
cover:this.fengImg,
disease_id:this.disease_id,
disease_name:this.disease,
content:this.diary_content,
doctor_id:this.diary_doctor_id,
doctor_name:this.diary_doctor,
id:''
}
console.log(params);
this.$requst.post('user/diary-save',params).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('保存成功');
uni.navigateBack({delta:1})
} else this.$toolAll.tools.showToast(res.msg);
},error=>{})
}
},
//
// checkDiaryInfo(id){
// this.$requst.get('user/diary-info',{id:id}).then(res=>{
// if(res.code==0){
// if(this.page==1) this.dataList = [];
// this.total = res.data.total;
// } else this.$toolAll.tools.showToast(res.msg);
// },error=>{})
// }
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,125 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'我的日记'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy30" style="padding-bottom: 160rpx;">
<view v-if="dataList.length!=0" class="mar-s30 bacf pad20" v-for="(item,index) in dataList" :key="index" style="border-radius: 28rpx;">
<view class="clips1">{{item.title}}</view>
<view class="mar-s20 fon24 col9">{{item.content}}</view>
<view class="disac fw mar-s20">
<image lazy-load class="diary-img mar-x10" @tap="preImg(index,index1)" :src="item1" v-for="(item1,index1) in item.imgArr" :key="index1" mode="aspectFill"></image>
</view>
<view class="disjbac mar-s20">
<view class="fon28 pcol bold">{{item.doctorName}}</view>
<view class="fon24 col9">{{item.creatTime}}</view>
</view>
<view @tap="delDiaryEv(item.id,index)" class="disac mar-s20 pad-s20" style="border-top: 2rpx solid #E6E6E6;">
<image src="../../static/public/del-diary.png" style="width: 20px;height: 20px;vertical-align: bottom;" mode=""></image>
<view class="fon28 colf8 bold" style="margin-top: -4rpx;">删除</view>
</view>
</view>
<nothing-page v-if="dataList.length==0" :content="'暂无日记'"></nothing-page>
</view>
<!-- 底部按钮 -->
<view class="posixzy pad-sx25">
<view @tap="goAddDiary" class="fon30 radius20 tc colf bold" style="margin: 0 83rpx;height: 90rpx;line-height: 90rpx;" :style="{background:publicColor}">添加日记</view>
</view>
<!-- 底部客服 -->
<public-customer></public-customer>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import {base64ToPath} from '@/jsFile/base64-src.js';
import {checkBanner} from '@/jsFile/publicAPI.js';
export default {
data() {
return {
optionObj:'',
dataList:[],
page:1,
size:20,
total:'',//
isZanw:true,
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onReachBottom() {
if(this.total!=this.dataList.length){
this.page++
this.checkDiaryEv()//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多日记','none',1000)
this.isZanw = false
}
},
onUnload: function() {
},
onShow() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkDiaryEv();
}
},
onLoad() {
},
methods: {
goAddDiary(){
uni.navigateTo({
url:'/pagesA/my-diary-edit/my-diary-edit'
})
},
checkDiaryEv(){
this.$requst.get('user/diary',{page:this.page,size:this.size}).then(res=>{
if(res.code==0){
if(this.page==1) this.dataList = [];
this.total = res.data.total;
if(res.data.list.length){
res.data.list.forEach(item=>{
let obj = {
id:item.id,
title:item.title,
content:item.content,
imgArr:item.images.split(','),
doctorName:item.doctor_name,
creatTime:item.created_at,
}
this.dataList.push(obj);
})
}
} else this.$toolAll.tools.showToast(res.msg);
},error=>{})
},
delDiaryEv(id,index){
this.$requst.get('user/diary-del',{id:id}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('删除成功');
this.dataList.splice(index,1);
} else this.$toolAll.tools.showToast(res.msg);
},error=>{})
},
preImg(index,num){
console.log(this.dataList[index]);
uni.previewImage({
current:this.dataList[index].imgArr[num],
urls:this.dataList[index].imgArr
})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,366 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'地址管理'" :statusTitle="true"></status-nav>
<view :style="{paddingTop:statusHeight+'px'}" class="mar-sx20 pad-zy32" style="padding-bottom: 150rpx;">
<view v-if="loading">
<view @tap="goBack(index)" v-for="(item,index) in dataList" :key="index" class="bacf radius20 pad20 mar-x20">
<view class="pad-y20 disjbac">
<view class="fon28 col3 bold">{{item.userName}} {{item.userPhone}}</view>
<image v-if="item.isActive" src="/static/public/chooseQuan.png" class="address_active" mode=""></image>
</view>
<view class="fon24 col9 mar-s25">{{item.userAddress}}</view>
<view class="disjbac fon28 col3 mar-s32">
<view @tap.stop="setMo(index)" class="disac">
<image v-if="item.isActive" src="/static/public/chooseQuan.png" class="address_active" mode=""></image>
<image v-else src="/static/public/cancle-FS.png" class="address_active" mode=""></image>
<view class="mar-z10" :class="item.isActive?'':'col9'">设为默认地址</view>
</view>
<view class="disac" style="color: #808080;">
<view @tap.stop="editAddress(index)">编辑</view>
<view @tap.stop="delAddress(index)" class="mar-y10 mar-z50">删除</view>
</view>
</view>
</view>
<view @tap.stop="obtainLngLat" class="posixzy address_add" style="bottom: 20rpx;">添加地址</view>
<view style="margin-top: 50%;">
<nothing-page v-if="dataList.length==0" :content="'暂无可用地址'"></nothing-page>
</view>
</view>
</view>
<!-- 添加地址修改地址 -->
<view v-if="idEdit" @tap.stop="idEdit=false" class="posAll disjcac" style="padding: 0 46rpx;z-index: 3;">
<view class="bacf width100" @tap.stop="idEdit=true" style="padding: 0 55rpx;border-radius: 23rpx;">
<view class="pad-sx20 posir">
<view class="fon28 bold col3 width100 tc">收件人地址</view>
<image class="posia address-close-btn" @tap.stop="idEdit=false" src="/static/public/addressClose.png" mode="aspectFill"></image>
</view>
<view class="pad-sx20 fon28 col3">
<view class="fon26 col9 mar-s30">收件人</view>
<view class="bbot mar-s30 pad-x10">
<input type="text" class="width100" v-model="userName" placeholder="请输入姓名" />
</view>
<view class="fon26 col9 mar-s30">手机号码</view>
<view class="bbot mar-s30 pad-x10">
<input type="num" maxlength="11" class="width100" v-model="userPhone" placeholder="请输入联系电话" />
</view>
<view class="fon26 col9 mar-s30">地址</view>
<view class="disjbac">
<view class="bbot mar-s30 pad-x10 posir disac" @tap="chooseProvinceCityCounty(0)">
<input type="text" class="width100 pad-y20" disabled v-model="userProvince" placeholder="四川" />
<view class="posia disjcac fc xiao-sanj" style="right: 0;">
<image src="/static/public/address-top.png" mode=""></image>
<image src="/static/public/address-down.png" mode=""></image>
</view>
<view :class="isAddress==1?'dong':''" class="posia info-box">
<view @tap.stop="chooseProvince(index)" class="clips1" v-for="(item,index) in provinceArr" :key="index">{{item.name}}</view>
</view>
</view>
<view class="bbot mar-s30 pad-x10 posir disac mar-zy30" @tap="chooseProvinceCityCounty(1)">
<input type="text" class="width100 pad-y20" disabled v-model="userCity" placeholder="成都" />
<view class="posia disjcac fc xiao-sanj" style="right: 0;">
<image src="/static/public/address-top.png" mode=""></image>
<image src="/static/public/address-down.png" mode=""></image>
</view>
<view :class="isAddress==2?'dong':''" class="posia info-box">
<view @tap.stop="chooseCity(index)" class="clips1" v-for="(item,index) in cityArr" :key="index">{{item.name}}</view>
</view>
</view>
<view class="bbot mar-s30 pad-x10 posir disac" @tap="chooseProvinceCityCounty(2)">
<input type="text" class="width100 pad-y20" disabled v-model="userCounty" placeholder="成华区" />
<view class="posia disjcac fc xiao-sanj" style="right: 0;">
<image src="/static/public/address-top.png" mode=""></image>
<image src="/static/public/address-down.png" mode=""></image>
</view>
<view :class="isAddress==3?'dong':''" class="posia info-box">
<view @tap.stop="chooseCounty(index)" class="clips1" v-for="(item,index) in countyArr" :key="index">{{item.name}}</view>
</view>
</view>
</view>
<view class="fon26 col9 mar-s30">详细地址</view>
<view class="bbot mar-s30 pad-x10">
<input type="text" class="width100" v-model="userAddress" placeholder="请输入详细地址" />
</view>
<!-- 确认保存按钮 -->
<view @tap.stop="addAddress" class="address-btn-add">确认保存</view>
</view>
</view>
</view>
</view>
</template>
<script>
import {lotusAddressJson} from '@/components/city/city.js';
export default {
data() {
return {
dataList:[],
idEdit:false,
userName:'',
userPhone:'',
userProvince:'',
userCity:'',
userCounty:'',
userAddress:'',
isChoose:'',//id
delNum:0,//
loading:false,
provinceArr:[],
cityArr:[],
countyArr:[],
isAddress:0,
isWhere:1,
isMo:0
}
},
computed: {
statusHeight() {
return this.$store.state.statusHeight
}
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
},
onLoad(options) {
this.isWhere = options.isWhere;
this.checkList();
},
methods: {
goBack(index){//
if(this.isWhere==0) {
uni.setStorageSync('chooseAddress',this.dataList[index]);
uni.navigateBack({delta:1})
}
},
obtainLngLat(){//
this.idEdit = true;
this.isMo = 0;
this.clearAll();
//
wx.getLocation({
success:(res)=> {
//
this.getDistrict(res.latitude, res.longitude)
},
})
},
getDistrict(latitude, longitude) {//
let ya = this
wx.request({
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=B2ABZ-SIDKS-WD2O3-6CJ2U-CDZOT-U3FKF`,
header: {
'Content-Type':'application/json'
},
success:function(res) {
// console.log('',res)
ya.userProvince = res.data.result.address_component.province
ya.userCity = res.data.result.address_component.city
ya.userCounty = res.data.result.address_component.district
lotusAddressJson.forEach((itema,index)=>{
if(ya.userProvince==itema.name) {
ya.chooseProvinceCityCounty(0);
ya.chooseProvince(index);
}
})
}
})
},
chooseProvinceCityCounty(index){
if(index==0){//
this.isAddress = 1;
this.provinceArr = []
lotusAddressJson.forEach((item,index)=>{
if(item.value.slice(2) =='0000'){
this.provinceArr.push(item)
}
})
}
if(index==1){//
if(this.cityArr.length!=0){
this.isAddress = 2;
}
}
if(index==2){//
if(this.countyArr.length==0){
this.$toolAll.tools.showToast('暂无可选项');
} else {
this.isAddress = 3;
}
}
},
chooseProvince(index){//
this.countyArr = this.cityArr = [];
this.userProvince = this.provinceArr[index].name;
lotusAddressJson.forEach(itema=>{
if(this.provinceArr[index].value==itema.parent) {
this.cityArr.push(itema)
}
})
this.isAddress = 0;
this.userCity = this.cityArr[0].name;//
this.chooseCity(0);
},
chooseCity(index){//
this.countyArr = [];
this.userCity = this.cityArr[index].name;
lotusAddressJson.forEach(itema=>{
if(this.cityArr[index].value==itema.parent) {
this.countyArr.push(itema)
}
})
this.isAddress = 0;
if(this.countyArr.length!=0) {
this.userCounty = this.countyArr[0].name;//
} else this.userCounty = '未知';
},
chooseCounty(index){//
this.isAddress = 0;
this.userCounty = this.countyArr[index].name;
},
async checkList(){//
this.$requst.post('user/address').then(res=>{
if(res.code==0){
this.dataList = [];
if(res.data.length!=0){
res.data.forEach(item=>{
let newActive = false;
if(item.is_default==1) newActive = true
let obj = {
id:item.id,
user_id:item.user_id,
userName:item.name,
userPhone:item.phone,
userAddress:item.province_str + item.city_str + item.county_str + item.address,
province:item.province_str,
city:item.city_str,
county:item.county_str,
address:item.address,
isActive:newActive,
is_default:item.is_default
}
this.dataList.push(obj);
})
this.checkActive();
}
this.loading = true;
}
})
},
checkActive(){//
let have = this.dataList.findIndex((res)=>{
return res.isActive == true;
});
this.dataList.unshift(this.dataList[have]);
this.dataList.splice(have+1,1);
},
async addAddress(){//
if(this.userName=='') {
this.$toolAll.tools.showToast('请输入姓名');
} else if(this.userPhone=='') {
this.$toolAll.tools.showToast('请输入联系电话');
} else if(this.$toolAll.tools.isPhone(this.userPhone)) {
this.$toolAll.tools.showToast('请输入正确的联系电话');
} else if(this.userAddress=='') {
this.$toolAll.tools.showToast('请输入详细地址');
} else {
let params = {
id:this.isChoose,
name:this.userName,
phone:this.userPhone,
city:'',//
county:'',//
province_str:this.userProvince,//
city_str:this.userCity,//
county_str:this.userCounty,//
address:this.userAddress,
is_default:this.isMo//
}
this.$requst.post('user/address-save',params).then(res=>{
if(res.code==0){
this.idEdit = false;
if(this.isChoose!='') {
this.$toolAll.tools.showToast('地址修改成功');
} else {
this.$toolAll.tools.showToast('新增地址成功');
}
setTimeout(()=>{
this.checkList();
this.clearAll();
},1000)
}
})
}
},
setMo(index){//
let params = {
id:this.dataList[index].id,
name:this.dataList[index].userName,
phone:this.dataList[index].userPhone,
city:'',//
county:'',//
province_str:this.dataList[index].province,//
city_str:this.dataList[index].city,//
county_str:this.dataList[index].county,//
address:this.dataList[index].address,
is_default:1//
}
this.$requst.post('user/address-save',params).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('设置默认地址成功');
this.dataList.forEach(item=>{
item.isActive = false;
});
this.dataList[index].isActive = true;
this.dataList[index].is_default = 1;
this.checkActive();
}
})
},
editAddress(index){//
this.idEdit = true;
this.isChoose = this.dataList[index].id,
this.userName = this.dataList[index].userName;
this.userPhone = this.dataList[index].userPhone;
this.userProvince = this.dataList[index].province;
this.userCity = this.dataList[index].city;
this.userCounty = this.dataList[index].county;
this.userAddress = this.dataList[index].address;
this.isMo = this.dataList[index].is_default
},
delAddress(index){//
this.delNum++
setTimeout(()=>{
this.delNum = 0;
},3000)
if(this.delNum==1) {
this.$toolAll.tools.showToast('双击即可删除');
}
if(this.delNum==2) {
this.$requst.post('user/address-del',{id:this.dataList[index].id}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('删除成功');
setTimeout(()=>{
this.checkList();
},1500)
}
})
}
},
clearAll(){//
this.isChoose = '',
this.userName = '';
this.userPhone = '';
this.userProvince = '';
this.userCity = '';
this.userCounty = '';
this.userAddress = '';
}
}
}
</script>
<style>
</style>

488
pagesA/myOrder/myOrder.vue Normal file
View File

@ -0,0 +1,488 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'订单管理'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<view class="isTopf bacf pad-zy30" :style="{top:statusHeight+'px'}">
<scroll-view scroll-x>
<view id="daoh" class="disjbac pad-s20">
<view @tap="chooseNav(indexn)" class="posir pad-s20 pad-zy20 pad-x30 flexs mar-y10" style="text-align: center;" :class="activeIndex==indexn?'activeD':''" :style="{color:activeIndex==indexn?'#3875F6':'#000000'}" v-for="(itemn,indexn) in statusList" :key="indexn">{{itemn}}</view>
</view>
</scroll-view>
</view>
<view :style="{paddingTop:(statusHeight+12+chuTop)+'px'}" class="pad-sx20 pad-zy32 pad-x180">
<view v-if="orderList.length!=0" v-for="(item,index) in orderList" :key="index" class="radius20 bacf pad20 mar-x20 order-item-box">
<view @tap="goDetail(item.id)" class="bbot disjbac pad-x20 mar-x20"><view class="fon28 col3 bold">{{item.isShop==0?'商城订单':'积分商城订单'}}</view>
<view v-if="item.is_only==0 && item.open_one==1 && item.is_group_make==1 && item.open_one_success==0" class="fon24 col9">{{item.group_make_end_at}}</view>
<view v-else class="fon24 col9">{{item.establish}}</view>
</view>
<view @tap="goDetail(item.id)" class="disjbac fon24">
<view class="col3">订单号{{item.orderNum}}</view>
<view v-if="item.virtual_check==0" class="bold" :class="(item.orderStatus==1 || item.orderStatus==2 || item.orderStatus==3) ? 'colf8':'col9'">{{item.status_text}}</view>
<view v-if="item.virtual_check==1" class="bold col9">{{item.status_text}}</view>
</view>
<view v-for="(itemc,indexc) in item.childrenList" :key="indexc" class="fon26 col3 disjbac pad-sx50 disjbac bbot posir" :style="{paddingBottom:itemc.is_virtual!=0?'70rpx':'50rpx'}">
<image lazy-load @tap="goDetail(item.id)" :src="itemc.imgSrc" class="flexs" mode="aspectFill"></image>
<view @tap="goDetail(item.id)" class="width100 disjb fc" style="height: 166rpx;">
<view>
<view class="fon28 col3 bold clips2">{{itemc.title}}</view>
<view class="order-sy">{{itemc.sku_name}}</view>
</view>
<view class="disjbac mar-s10">
<view class="colf8 fon32 bold"><span v-if="item.isShop==0"></span><span v-else></span>{{itemc.price}}<span class="fon28 col6 mar-z20 font4">x{{itemc.num}}</span></view>
<view @tap.stop="make(index,indexc)" v-if="itemc.is_virtual!=0 && itemc.check_type=='frontend' && itemc.not_check_num!=0 && item.orderStatus!=1" class="order-btn">线</view>
<view v-if="itemc.is_virtual!=0 && itemc.check_type!='frontend'" class="order-btn" style="background-color: #CCCCCC;">线</view>
</view>
</view>
<view v-if="itemc.is_virtual!=0 && itemc.not_check_num!=0" class="mar-s10 posia col6" style="bottom: 20rpx; right: 0rpx;"> x{{itemc.not_check_num}}</view>
</view>
<!-- <view class="fon28 col3 pad-s20 disjbac">
<view class="flexs"><span v-if="item.isShop==0"><span v-if="item.is_only!=1">{{item.total}}</span><span v-if="item.is_only==1">{{item.total}}</span> +<span v-if="item.coin!=0">{{item.coin}}</span></span><span v-else>{{item.total}}</span></view>
<view class="width100 disac" style="justify-content: flex-end;">
<view @tap="transferFrame(index)" v-if="item.orderStatus != 0 && item.orderStatus != 5" class="order-cancle"></view>
<view @tap="payMentEv(index)" v-if="item.orderStatus == 1" class="order-btn"></view>
<view @tap="isHeyan=true" v-if="item.orderStatus == 3" class="order-btn">线</view>
<view class="order-btn">单人拼团</view>
<view @tap="confirmReceipt(item.id)" v-if="item.orderStatus == 4" class="order-btn"></view>
</view>
</view> -->
<view class="fon28 col3">
<view class="mar-sx20 disjbac">
<view>
<view class="" v-if="item.group">
<!-- <view v-if="item.is_only==0 && item.open_one==1 && item.is_group_make==1 && item.open_one_success==0" class="posir disjcac flexs" style="color: #010101;font-size: 24rpx;"> -->
<view v-if="item.is_only==0 && item.group.surplus > 0" class="posir disjcac flexs" style="color: #010101;font-size: 24rpx;">
<image src="../../static/public/weix.png" mode="" class="flexs" style="width: 50rpx;height: 50rpx;"></image>
分享给朋友
<button open-type="share"
:data-title="item.childrenList[0].title"
:data-is_activity="item.childrenList[0].is_activity"
:data-imgsrc="item.childrenList[0].imgSrc"
:data-id="item.childrenList[0].spu_activity_id || item.childrenList[0].sku_id"
class="posia-op">分享给朋友</button>
</view>
</view>
</view>
<view>
<span v-if="item.isShop==0"><span v-if="item.is_only!=1">{{item.total}}</span><span v-if="item.is_only==1">{{item.total}}</span> <span v-if="item.coin!=0">+{{item.coin}}</span></span><span v-else>{{item.total}}</span>
</view>
</view>
<view class="disjbac">
<view class="width100 disje">
<view class="" v-if="item.group">
<view v-if="item.group.surplus > 0">
<view @tap="comeing(item.orderNum)" v-if="item.is_only==0 && item.open_one==1 && item.is_group_make==1 && item.open_one_success==0" class="order-btn mar-y20"></view>
</view>
</view>
<view @tap="transferFrame(index)" v-if="item.orderStatus != 0 && item.orderStatus != 5 && item.virtual_check==0 && item.orderStatus!=5" class="order-cancle"></view>
<view @tap="payMentEv(index)" v-if="item.orderStatus == 1" class="order-btn"></view>
<!-- <view class="order-btn" v-if="item.is_only==1"></view> -->
<view @tap="confirmReceipt(item.id)" v-if="item.orderStatus == 4" class="order-btn"></view>
</view>
</view>
</view>
</view>
<nothing-page v-if="orderList.length==0" :content="`暂无更多订单列表`"></nothing-page>
</view>
<!-- 待核验弹框 -->
<view v-if="isHeyan" @tap="isHeyan=false" class="disjcac tc posAll" style="z-index: 3;" catchtouchmove="return">
<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="qsize" :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="closeEv" src="/static/public/closequan.png" class="posia heyan-close" mode=""></image>
</view>
</view>
<!-- 取消订单弹框 -->
<view v-if="isCancle" @tap.stop="isCancle=false" class="posAll">
<view class="bacf posixzy order-cancle-tk" @tap.stop="isCancle=true">
<view>
<view class="bbot pad-sx20 posir">
<view class="fon28 bold col3 width100" style="text-align: center;">取消订单</view>
<image class="posia order-close-btn" @tap.stop="isCancle=false" src="/static/public/cha-close.png" mode="aspectFill"></image>
</view>
<view class="pad-zy32 pad-sx20 col5b">
<view class="fon24 linh40">
<view>温馨提示</view>
<view>订单取消需要提交工作人员审核商品金额将原路径返还账户订单一旦取消系统无法恢复</view>
</view>
<view @tap.stop="chooseReason(indexy)" v-for="(itemy,indexy) in reasonList" :key="indexy" class="disac mar-s40">
<image v-if="itemy.isActive" src="/static/public/chooseFS.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
<image v-else src="/static/public/cancle-FS.png" style="width: 40rpx;height: 40rpx;" mode=""></image>
<view class="mar-z20 fon28">{{itemy.title}}</view>
</view>
<!-- 确认取消按钮 -->
<view @tap.stop="confirmEv" class="confirm-btn">确认取消</view>
</view>
</view>
</view>
</view>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
</view>
</template>
<script>
import yzQr from '@/components/yz-qr/yz-qr.vue';
export default {
components:{
yzQr
},
data() {
return {
chuTop:'',//
activeIndex:'',
statusList:['全部','待付款','待发货','待核验','待收货','已完成'],
//
reasonList:[
{title:'不想要了/买多了/买错了',isActive:true},
{title:'地址信息填写错误',isActive:false},
{title:'其他原因',isActive:false},
],
isHeyan:false,//线
isCancle:false,//
orderList:[],
zanList:[],//
page:1,
size:10,
total:'',//
isZanw:true,
tag:'',// waiting= paid= shipped= completed= check=
current:0,//
remarks:'',//
times:0,//
canvasQrPath: '',
text: '',
qsize: 162,
colorDark: '#000000',
colorLight: '#ffffff',
timer:null,
zanArr:[],
timeList:[],
orderInfo:{},
checkGrounpId:0,
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onShareAppMessage(res) {
var shareObj = {
     title: res.target.dataset.title, // (slogan)
     path: `/pagesB/shopDetail/shopDetail?id=${res.target.dataset.id}&category_id=0&is_activity=${res.target.dataset.is_activity}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
     imageUrl: res.target.dataset.imgsrc//PNGJPG imageUrl 使 5:4
  };
  return shareObj;
//   return false;
},
onReachBottom() {
if(this.total!=this.orderList.length){
this.page++
this.checkList(this.activeIndex)//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多记录','none',1000)
this.isZanw = false
}
},
onUnload() {
this.closeEv();
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
this.checkZT(this.activeIndex);
this.checkList(this.activeIndex);
},
onLoad(options) {
options.index==undefined ? this.activeIndex = 0 : this.activeIndex = options.index;
const query = wx.createSelectorQuery()
query.select('#daoh').boundingClientRect((rect) => {
// console.log('+',rect);
this.chuTop = rect.height
}).exec()
},
methods: {
comeing(coding){
this.$requst.post('user/open-one',{order_coding:coding}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('免拼成功');
this.checkList(this.activeIndex);
}
})
},
make(index,index2){
this.isHeyan = true;
this.text = `${this.orderList[index].orderNum}H${this.orderList[index].childrenList[index2].id}`;
let params = {
order_coding:this.orderList[index].orderNum,
id:this.orderList[index].childrenList[index2].id,
not_check_num:this.orderList[index].childrenList[index2].not_check_num
}
this.timer = setInterval(()=>{
this.$requst.post('order/check-result',params).then(res=>{
if(res.code==0){
if(res.data.result==1){
this.isHeyan = false;
this.$toolAll.tools.showToast('已完成');
this.checkList(this.activeIndex);
clearInterval(this.timer);
}
}
})
},3000)
// var that = this;
// setTimeout(function() {
// that.canvasQrPath = that.$refs.qrPath.canvasQrPath;
// console.log(':', that.canvasQrPath)
// }, 1000)
},
closeEv(){
this.isHeyan = false;
clearInterval(this.timer);
},
checkZT(index){
if(index==0){this.tag=""}
if(index==1){this.tag="waiting"}
if(index==2){this.tag="paid"}
if(index==3){this.tag="check"}
if(index==4){this.tag="shipped"}
if(index==5){this.tag="completed"}
},
chooseNav(index){
this.page =1;
this.activeIndex = index;
this.checkZT(index);
this.checkList(index);
},
checkList(index){//
this.$requst.post('user/order',{page:this.page,size:this.size,tag:this.tag}).then(res=>{
if(res.code==0){
if(this.page==1) {
uni.pageScrollTo({//
scrollTop: 0,
duration: 0
});
this.orderList = [];
this.zanArr = [];
this.timeList = [];
}
this.total = res.data.total;
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let statusNum = 0;
if(item.status=="waiting") statusNum = 1;
// if(item.status=="paid" && item.has_virtual==1) {
// statusNum = 3;
// }
if(item.status=="paid") {
statusNum = 2;
}
if(item.status=="check") statusNum = 3;
if(item.status=="shipped") statusNum = 4;
if(item.status=="completed") statusNum = 5;
let nprice = '';
if(item.is_score==0) nprice = this.$toolAll.tools.addXiaoShu(item.price/100);
if(item.is_score==1) nprice = item.score;
let nchildren = [];
item.skus.forEach(items=>{
let childrenPrice = '';
if(item.is_score==0) childrenPrice = items.price/100
if(item.is_score==1) childrenPrice = items.score
let objs = {
id:items.id,
imgSrc:this.$http + items.spu_cover,
title:items.spu_name,
sku_name:items.sku_name,
price:childrenPrice,
num:items.num,
not_check_num:items.not_check_num,
check_type:items.check_type,
is_virtual:items.is_virtual,
activity_type:items.activity_type,
is_activity:items.is_activity,
spu_id:items.spu_id,
spu_activity_id:items.spu_activity_id,
}
nchildren.push(objs);
})
let obj = {
id:item.id,
establish:item.created_at,//
orderNum:item.coding,//
childrenList:nchildren,
orderStatus:statusNum,//1 2 3 4 5
isShop:item.is_score,//0 ,1
total: nprice,//
coin:item.coin,//
is_only:item.is_only,//,1
virtual_check:item.virtual_check,
open_one:item.open_one,
open_one_success:item.open_one_success,
is_group_make:item.is_group_make,
group_make_end_at:item.group_make_end_at,
group_id:item.group_id,
status_text: item.group!=null && item.status_text!='已完成' && item.status_text!='待付款' ? (item.group.surplus > 0 ? '待拼成' : item.status_text) : item.status_text,//
group:item.group//
}
this.zanArr.push(obj);
})
this.zanArr.forEach((item,index)=>{
if(item.group_make_end_at!='' && item.group_make_end_at!=null) {
let obj = {
id:item.id,
time:item.group_make_end_at,
nIndex:index
}
this.timeList.push(obj);
}
})
if(this.timeList!=0){
uni.showToast({
title:'加载中...',
icon:'none',
duration:100000
})
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();//
let startTime = new Date().getTime() + 1000;//
if(startTime - endTime >=0) {// - >= 0
// this.checkList(this.activeIndex);
} else {
//
this.zanArr[item.nIndex].group_make_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,startTime);
}
}
})
}
},1000)
setTimeout(()=>{
uni.hideToast();
this.orderList = this.zanArr;
// this.search_result = true;
},1000)
} else {
uni.hideToast();
this.orderList = this.zanArr;
}
this.zanList = this.orderList;
if(index==0) {
this.orderList = this.zanList;
} else if(index==3){
} else {
this.orderList = this.zanList.filter(item=>{
return item.orderStatus==index;
});
}
}
}
})
},
payMentEv(index){//
this.$requst.post('order/pay',{order_coding:this.orderList[this.current].orderNum}).then(res=>{
if(res.code==0){
uni.requestPayment({
provider: 'wxpay',
appId:res.data.payment_params.appId,//appId
timeStamp: res.data.payment_params.timeStamp,//
nonceStr: res.data.payment_params.nonceStr,//
package: res.data.payment_params.package,//package
signType: res.data.payment_params.signType,//MD5
paySign: res.data.payment_params.sign,//
success:(res)=> {
this.$requst.post('order/paid',{order_coding:this.orderList[this.current].orderNum}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('付款成功');
this.checkList(this.activeIndex)
} else this.$toolAll.tools.showToast(res.msg);
})
}
});
}
})
},
hexiaoEv(){//
this.$requst.post('order/check').then(res=>{
if(res.code==0){
}
})
},
transferFrame(index){//
this.isCancle = true;
this.current = index;
this.reasonList.forEach(item=>{
item.isActive = false;
})
this.reasonList[0].isActive = true;
},
chooseReason(index){//
this.reasonList.forEach(item=>item.isActive = false);
this.reasonList[index].isActive = true;
this.remarks = this.reasonList[index].title;
},
confirmEv(){//
if(this.times==0){
this.times++;
this.$toolAll.tools.showToast('正在取消...');
this.$requst.post('order/cancel',{order_coding:this.orderList[this.current].orderNum,remarks:this.remarks}).then(res=>{
if(res.code==0){
this.isCancle = false;
this.orderList.splice(this.current,1);
this.page = 1;
this.checkList(this.activeIndex);
this.$toolAll.tools.showToast('取消成功');
this.times = 0;
} else this.$toolAll.tools.showToast(res.msg);
})
}
},
confirmReceipt(id){//
this.$requst.post('order/accepted',{order_id:id}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('收货成功');
this.checkList(this.activeIndex);
} else this.$toolAll.tools.showToast(res.msg);
})
},
goDetail(id){//
uni.navigateTo({
url:`/pagesB/orderDetail/orderDetail?id=${id}`
})
}
}
}
</script>
<style>
.activeD::after{
content: '';
display: block;
position: absolute;
bottom: 0;
left: 0;
height: 8rpx;
background: #3875F6;
width: 100%;
}
</style>

View File

@ -0,0 +1,289 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'修改资料'" :whereCome="whereCome" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="fon28 pad-x20">
<view v-for="(itemd,indexd) in dataList" :key="indexd"
class="disjbac borbot mar-zy40" :class="(indexd!=1 && indexd!=5 && indexd!=6) ? 'pad-sx40':''">
<!-- 标题 -->
<view class="col9 flexs" style="width: 17.8%;">
<view v-if="indexd!=2 && indexd!=3 && indexd!=7">{{itemd.title}}:</view>
<!-- ID -->
<view v-if="indexd==2" class="disjb">
<view class="disjb width100">
<view>{{itemd.title.charAt(0)}}</view>
<view>{{itemd.title.charAt(1)}}</view>
<view>{{itemd.title.charAt(2)}}{{itemd.title.charAt(3)}}</view>
</view>
<view>:</view>
</view>
<!-- 性别地址 -->
<view v-if="indexd==3 || indexd==7" class="disjb">
<view class="disjb width100">
<view>{{itemd.title.charAt(0)}}</view>
<view>{{itemd.title.charAt(1)}}</view>
</view>
<view>:</view>
</view>
</view>
<view class="disac fe width100 tright">
<!-- 内容 -->
<view v-if="itemd.content!='' && (indexd!=1 && indexd!=5 && indexd!=6)" :class="indexd==1?'nic':'col3'" class="mar-y20 width100" :style="{marginRight:indexd==2?'39rpx':''}">{{itemd.content}}</view>
<!-- 性别下拉弹框 -->
<picker v-if="indexd==3" class="col3 mar-y20 width100" @change="changePicker" :value="current" :range="pickerData">
<view>{{pickerData[current]}}</view>
</picker>
<!-- 出生日期下拉框 -->
<picker v-if="indexd==4" mode="date" class="col3 mar-y20 width100" @change="changeTime" :value="currentt" :range="pickerTime">
<view>{{pickerTime[currentt]}}</view>
</picker>
<!-- 地址下拉框 -->
<!-- <picker v-if="indexd==7" mode="multiSelector" class="col3 mar-y20 width100" @change="changeAddress" :value="currenta" :range="pickerAddress">
<view>{{pickerAddress[0]}}{{pickerAddress[1]}}{{pickerAddress[2]}}</view>
</picker> -->
<!-- <view v-if="indexd==7" @tap="openPicker" class="width100 mar-y20">{{region}}</view> -->
<view v-if="indexd==7" @tap="openAddres2" class="width100 mar-y20">{{pickerText}}</view>
<!-- 用户昵称真实姓名联系电话输入框 -->
<input @focus="inputFo(indexd)" @blur="inputB(indexd)" v-if="indexd==1 || indexd==5 || indexd==6" :disabled="indexd==6" :type="(indexd==1 || indexd==5)?'text':'number'" :maxlength="indexd==6?11:10" v-model="itemd.content" class="mar-y20 tright pad-sx40 width100" style="border: none;" :placeholder="itemd.fcon"/>
<!-- 用户头像 -->
<image v-if="indexd==0" :src="itemd.imgSrc || appletImg" :class="indexd==0?'head_img':'head_next'" class="" mode="aspectFill"></image>
<!-- <image @tap="chooseHead" v-if="itemd.imgSrc!=''" :src="itemd.imgSrc" :class="indexd==0?'head_img':'head_next'" class="" mode="aspectFill"></image> -->
<!-- 前进键 -->
<image v-if="indexd!=0 && indexd!=2" src="/static/public/nexth.png" class="head_next flexs"></image>
</view>
</view>
</view>
<view class="" @tap="updataInfo" style="height: 90rpx;line-height: 90rpx;margin: 80rpx 100rpx 120rpx 100rpx;" class="radius20 fon40 bold colf tc" :style="{background:publicColor}">{{btnCon}}</view>
<!-- 底部弹框 -->
<!-- <city @choseVal="choseValue" :lotusAddressData="lotusAddressData"></city> -->
<simple-address ref="simpleAddress" :pickerValueDefault="cityPickerValueDefault" @onConfirm="onConfirm" themeColor="#007AFF"></simple-address>
<!-- 底部客服 -->
<public-customer :nbottom="100"></public-customer>
</view>
</template>
<script>
import simpleAddress from '@/components/simple-address/simple-address.vue';
export default {
components:{
// city,
simpleAddress
},
data() {
return {
dataList:[
{title:'用户头像',content:'',imgSrc:'',fcon:''},
{title:'用户昵称',content:'',imgSrc:'',fcon:'请输入用户昵称'},
{title:'ID',content:'',imgSrc:'',fcon:''},
{title:'性别',content:'',imgSrc:'',fcon:''},
{title:'出生日期',content:'',imgSrc:'',fcon:''},
{title:'真实姓名',content:'',imgSrc:'',fcon:'请输入真实姓名'},
{title:'联系电话',content:'',imgSrc:'',fcon:'请输入联系电话'},
{title:'地址',content:'',imgSrc:'',fcon:''},
],
isKuang:true,
current:0,
pickerData:['未知','男','女'],
currentt:0,
pickerTime:['1997-01-01'],
currenta:0,
// pickerAddress:[' ',' ',''],
// lotusAddressData:{
// visible:false,
// provinceName:'',
// cityName:'',
// townName:'',
// },
// region:'',
cityPickerValueDefault: [0, 0, 1],
pickerText: '四川省成都市成华区',
btnCon:'保存',
uinfo:{},
addressInfo:[],
newProvice:'',//
newCity:'',//
newDistrict:'',//
whereCome:0,
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
},
onUnload() {
uni.removeStorageSync('firstInfo')
},
onLoad(options) {
if(options.whereNum==2){
this.whereCome = options.whereNum
}
let chuo = new Date().getTime()//
let time = this.$toolAll.tools.timestampToTime(chuo)// XXXX-XX-XX
//
wx.getLocation({
success:(res)=> {
//
this.getDistrict(res.latitude, res.longitude)
},
})
let firstObj = uni.getStorageSync('firstInfo')
if(firstObj==''){
let obj = uni.getStorageSync('uinfo')
if(obj!='') this.uinfo = obj
this.dataList[0].imgSrc = obj.headimgurl//
this.dataList[1].content = obj.nickname//
this.dataList[2].content = obj.coding//ID
this.current = obj.gender//12,0
obj.birthday!='' ? this.pickerTime = [obj.birthday.slice(0,10)] : this.pickerTime = [time.slice(0,10)]//
obj.real_name!=null && obj.real_name !='' ? this.dataList[5].content = obj.real_name : this.dataList[5].fcon = '未知'//
obj.mobile!='' ? this.dataList[6].content = obj.mobile : this.dataList[6].fcon = '未知'//
if(obj.county!='') this.pickerText = obj.province + obj.city + obj.county//
} else {
this.dataList[0].imgSrc = firstObj.headimgurl//
this.dataList[1].content = firstObj.nickname//
this.dataList[2].content = firstObj.coding//ID
this.current = firstObj.gender//12,0
}
},
methods: {
updataInfo(){//
let params = {
real_name:this.dataList[5].content,//
nickname:this.dataList[1].content,//
mobile:this.dataList[6].content,//
gender:this.current,//012
province:this.addressInfo[0],//
city:this.addressInfo[1],//
county:this.addressInfo[2],//
birthday:this.pickerTime[0]//2021-08-10
}
this.$requst.post('user/edit-info',params).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('资料修改成功')
setTimeout(()=>{
if(this.whereCome==2){
uni.navigateTo({
url:'/pages/tabbar/my/staffDuan'
})
} else {
uni.navigateBack({delta:1})
}
},1000)
}
},error=>{})
},
getDistrict(latitude, longitude) {//
let ya = this
wx.request({
url: `https://apis.map.qq.com/ws/geocoder/v1/?location=${latitude},${longitude}&key=B2ABZ-SIDKS-WD2O3-6CJ2U-CDZOT-U3FKF`,
header: {
'Content-Type':'application/json'
},
success:function(res) {
// console.log('',res)
ya.newProvice = res.data.result.address_component.province
ya.newCity = res.data.result.address_component.city
ya.newDistrict = res.data.result.address_component.district
if(ya.pickerText=='') ya.pickerText = ya.newProvice + ya.newCity + ya.newDistrict
}
})
},
openAddres2() {//
// label
var index = this.$refs.simpleAddress.queryIndex([this.newProvice, this.newCity, this.newDistrict], 'label');
this.cityPickerValueDefault = index.index;
this.$refs.simpleAddress.open();
},
onConfirm(e) {//
this.pickerText = e.labelArr[0]+e.labelArr[1]+e.labelArr[2];
this.addressInfo = [e.labelArr[0],e.labelArr[1],e.labelArr[2]]
},
chooseHead(){//
uni.chooseImage({
count:1,
success: (res) => {
this.dataList[0].imgSrc = res.tempFilePaths[0]
}
})
},
changePicker(e){//
this.current = e.detail.value
},
changeTime(e){//
this.pickerTime = [e.detail.value]
},
changeAddress(e){
},
inputFo(index){//
if(this.dataList[index].content!=''){
this.dataList[index].fcon = this.dataList[index].content//placeholder
this.dataList[index].content = ''//
}
},
inputB(index){//
if(index==1){
if(this.dataList[1].content==''){
this.dataList[1].content = this.uinfo.nickname
}
}
if(index==5){
if(this.dataList[5].content==''){
this.dataList[5].content = this.uinfo.real_name
}
}
if(index==6){
if(this.dataList[6].content==''){
this.dataList[6].content = this.uinfo.mobile
}
}
}
//picker
// openPicker() {
// this.lotusAddressData.visible = true;
// this.lotusAddressData.provinceName = this.newProvice;
// this.lotusAddressData.cityName = this.newCity;
// this.lotusAddressData.townName = this.newDistrict;
// },
//
// choseValue(res){
// //rescode
// // console.log(res);
// this.lotusAddressData.visible = res.visible;//visibletruefalse
// //res.isChose = 1 res.isChose = 0;
// if(res.isChose){
// this.lotusAddressData.provinceName = res.province;//
// this.lotusAddressData.cityName = res.city;//
// this.lotusAddressData.townName = res.town;//
// this.region = `${res.province} ${res.city} ${res.town}`; //region
// this.regionObj = {
// province:res.province,
// provinceCode:res.provinceCode,
// city:res.city,
// cityCode:res.cityCode,
// town:res.town,
// townCode:res.townCode
// }
// }
// },
}
}
</script>
<style>
page{background-color: #FFFFFF;}
</style>

View File

@ -0,0 +1,188 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'孔雀币管理'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy30 fon28 col3 pad-x180">
<view class="mar-s20 bacf pad20 radius20">
<view class="mar-x30">当前孔雀币</view>
<view class="disjbac">
<view class="disjcac fc width33" style="align-items: flex-start;">
<view class="fon36 bold mar-z20">{{dangKQ}}</view>
<view class="mar-s36 coin-tx-btn" @tap="isTiX=true"></view>
</view>
<view class="disjcac fc width33">
<view class="fon36 bold">{{shenHZ}}<span class="coin-yuan"></span></view>
<view class="mar-s36 fon26 col3 coin-miao">审核中</view>
</view>
<view class="disjcac fc width33">
<view class="fon36 bold">{{yiTKQ}}<span class="coin-yuan"></span></view>
<view class="mar-s36 fon26 col3 coin-miao">已提现</view>
</view>
</view>
</view>
<!-- 获取列表提现列表 -->
<view class="mar-s20 bacf pad20 radius20">
<view class="mar-x50 fon28 disja">
<view @tap="switchState(true)" :class="activeJF?'col3 bold':'col9'">获取列表</view>
<view @tap="switchState(false)" :class="!activeJF?'col3 bold':'col9'">支出列表</view>
</view>
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
<view>
<view class="fon26 col3">{{item.title}}</view>
<view class="mar-s10 fon20 col9">{{item.time}}</view>
</view>
<view v-show="activeJF" class="fon36 bold pcol">+{{item.num}}</view>
<view v-show="!activeJF" class="fon36 bold">{{item.num}}</view>
</view>
</view>
<!-- 分享按钮 -->
<view class="disjcac coin-share-box">
<image src="/static/public/bottom-shear.png" mode=""></image>
<view class="fon40 colf bold mar-z10">分享给好友</view>
<button class="posia-op" open-type="share"></button>
</view>
<!-- 提现弹框 -->
<view v-if="isTiX" @tap="isTiX=false" class="disjcac tc tx-tk-box">
<view class="bacf width100 radius20 pad30 mar-zy85" @tap.stop="isTiX=true">
<view class="fon28 bold col34">孔雀币提现</view>
<view class="fon28 mar-s30 col34 font5">兑换比例{{kqbl}}孔雀币兑换{{whatPrice}}元人民币</view>
<view class="fon24 mar-s10 mar-x30 colf8 font5">最低提现金额为{{limit_price}}</view>
<input type="number" v-model="kNum" placeholder="请输入孔雀币" class="width100 radius10"/>
<view class="disjbac">
<view @tap.stop="confrimT" class="tk-btn pbackc">立即提现</view>
<view @tap.stop="isTiX=false" class="tk-btn">暂不提现</view>
</view>
</view>
</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {
activeJF:true,
kNum:'',//
dataList:[
// {title:'',time:'2021.09.06 10:30:10',num:'1'},
// {title:'',time:'2021.09.06 10:30:10',num:'1'},
// {title:'',time:'2021.09.06 10:30:10',num:'1'},
// {title:'',time:'2021.09.06 10:30:10',num:'1'},
],
isTiX:false,
dangKQ:3000,//
shenHZ:300 ,//
yiTKQ:0 ,//
kqbl:0,//
whatPrice:0,//
ntype:'in',//coin: withdrawal
times:0,//
page:1,
size:10,
total:'',//
isZanw:true,
realPrice:0,//
limit_price:0//
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
}
},
onReachBottom() {
if(this.total!=this.dataList.length){
this.page++
this.checkList(this.ntype)//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多记录','none',1000)
this.isZanw = false
}
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
},
onLoad(options) {
this.checkInfo();
this.checkList(this.ntype);
},
methods: {
confrimT(){//
this.realPrice = this.whatPrice / this.kqbl * this.kNum;
if(this.kNum=='' || this.kNum<=0){
this.$toolAll.tools.showToast('请输入孔雀币数量');
} else if(this.kNum > this.dangKQ){
this.$toolAll.tools.showToast('请输入正确的孔雀币数量');
} else if((this.limit_price - this.realPrice) > 0 ){
this.$toolAll.tools.showToast(`最低提现${this.limit_price}`);
} else {
if(this.times==0){
this.times++;
this.$requst.post('user/withdrawal-coin',{coin:this.kNum}).then(res=>{
if(res.code==0){
this.isTiX = false;
this.$toolAll.tools.showToast('提现已提交审核');
setTimeout(()=>{
this.dataList = [];
this.page =1;
this.isZanw = true;
this.ntype = 'out';
this.checkInfo();//
this.checkList(this.ntype);//
this.activeJF = false;
this.times = 0;//
this.kNum = '';//
},1500)
} else this.$toolAll.tools.showToast(res.msg);
})
}
}
},
checkList(ntype){//
this.$requst.post('user/coin-log',{type:ntype,page:this.page,size:this.size}).then(res=>{
if(res.code==0){
if(this.page==1) this.dataList = [];
this.total = res.data.total;
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let obj = {
title:item.name,
time:item.created_at,
num:item.num
}
this.dataList.push(obj);
})
}
}
})
},
checkInfo(){//
this.$requst.post('user/coin-load').then(res=>{
if(res.code==0){
this.dangKQ = res.data.coin;//
this.shenHZ = res.data.withdrawal_ing;//
this.yiTKQ = res.data.withdrawald;//
this.limit_price = res.data.limit_price*1;//
this.kqbl = res.data.withdrawal_proportion.coin;//
this.whatPrice = res.data.withdrawal_proportion.money;//
}
})
},
switchState(flag){//
this.dataList = [];
this.activeJF = flag;
this.page =1;
this.isZanw = true;
if(flag) {
this.ntype ='in';
this.checkList(this.ntype);
} else {
this.ntype ='out';
this.checkList(this.ntype);
}
},
}
}
</script>

View File

@ -0,0 +1,196 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'积分商城'" :statusTitle="true"></status-nav>
<!-- 搜索输入框 -->
<view class="search-input-box bacf poszy jf-input-box" :style="{top: statusHeight+'px'}">
<view class="disac pad-zy30 mar-s20">
<!-- 输入框 -->
<input class="width100 fon34 radius10" @confirm="searchKey" type="text" v-model="searchVal" placeholder="请输入商品名称"/>
<!-- 搜索 -->
<view class="flexs mar-z30 radius10 pad-zy40 fon34 colf" @tap="searchKey" :style="{background:publicColor}">搜索</view>
</view>
<!-- 分类标题 -->
<view class="disjbac pad-zy20 pad-s20 bacf fon24">
<view v-for="(item,index) in shopCate" class="disjcac" @tap="chooseShopCate(index)" :class="activeIndex==index?'activecate':'shopMo'" :style="{background:activeIndex==index?publicColor:'#F2F2F2'}" :key="index">
<span>{{item}}</span>
<view class="disjcac fc mar-z10" v-if="index==2 || index==3">
<image src="/static/public/address-top.png" mode=""></image>
<image src="/static/public/address-down.png" mode=""></image>
</view>
</view>
</view>
</view>
<!-- 数据列表 -->
<view :style="{marginTop:statusHeight+titleHeight+'px'}">
<score-list id="myComponent" :dataList="dataList" v-if="dataList.length!=0"></score-list>
<nothing-page v-if="dataList.length==0" :content="`暂无更多${searchVal}积分商品`"></nothing-page>
</view>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='4'></foot-tab>
<!-- 购物车 -->
<navigator url="/pagesA/shopCart/shopCart?isScore=score" hover-class="none">
<view class="cart-box">
<view class="posir">
<image src="/static/public/cart.png" mode="aspectFill"></image>
<view class="posia" v-if="cartNum!=0"><view>{{cartNum}}</view></view>
</view>
</view>
</navigator>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import scoreList from '@/components/score-list.vue';
export default {
components:{
scoreList
},
data() {
return {
activeIndex:0,
shopCate:['综合','最新','兑换量','积分'],
titleHeight:'',//
dataList:[],
searchVal:'',//
type:'normal',//type=normal newest=
sort_field:'',// score= num=
sort_value:'asc',// asc= desc=
cishu:0,
cartNum:0,
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onShow() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.cartNumEv();
}
},
onLoad(options) {
// +
const query = wx.createSelectorQuery()
query.select('.search-input-box').boundingClientRect((rect) => {
// console.log('+',rect.height);
this.titleHeight = rect.height
}).exec()
// tools.js
this.$toolAll.tools.plantPoint(12);
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkList();
}
},
methods: {
cartNumEv(){//
this.$requst.post('order/shopping-cart-count',{type:'score'}).then(res=>{
if(res.code==0){
this.cartNum = res.data.count;
}
})
},
checkList(){//
let params = {
keyword:this.searchVal,//
page:1,
size:10,
type:this.type,//type=normal newest=
sort_field:this.sort_field,// score= num=
sort_value:this.sort_value// asc= desc=
}
this.$requst.post('spu/score',params).then(res=>{
if(res.code==0){
this.dataList = [];
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let obj = {
id:item.id,
imgSrc: this.$http + item.cover,
saleable:item.saleable,//
stock:item.stock,//
title: item.name,
zhePrice:item.price,
yuanPrice:item.original_price,
integral:item.score,
isTuan:false,
isPing:false,
isXian:false,
isIntegral:true,
grade:item.level_id,
published_at:item.published_at,//
amount:item.amount,//
level_text:item.level_text//
}
this.dataList.push(obj)
})
} else {
this.$toolAll.tools.showToast('暂无更多积分商品')
}
}
})
},
searchKey(){//
if(this.activeIndex==0) {
this.clearVal();
this.type = 'normal';
}
if(this.activeIndex==2 || this.activeIndex==3) this.sort_value = 'asc';
this.checkList();
},
chooseShopCate(index){//
this.activeIndex = index;
this.type = '';
this.sort_field = '';
if(index==0) this.type = 'normal';
if(index==1) this.type = 'newest';
this.cishu++
if(index==2) {
this.sort_field = 'amount';
if(this.cishu%2==0) {
this.sort_value = 'asc';
} else this.sort_value = 'desc';
}
if(index==3) {
this.sort_field = 'score';
if(this.cishu%2==0) {
this.sort_value = 'asc';
} else this.sort_value = 'desc';
}
this.checkList();
},
clearVal(){
this.type = '';
this.sort_field = '';
}
}
}
</script>
<style>
page{background: #F5F5F5;}
.activecate,.shopMo{border-radius: 20rpx;text-align: center;background-color: #f2f2f2;color: #333333;padding: 16rpx 25rpx;width: 100rpx;}
.activecate{color: #FFFFFF;}
.activecate image{
-webkit-filter: invert(1); /* Chrome, Safari, Opera */
filter: invert(1);
}
</style>

View File

@ -0,0 +1,308 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'自主预约'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy20">
<view class="bacf mar-s25 pad-zy20 radius20 fon28 col3 pad-x40">
<view class="disac pad-s32">
<view class="flexs mar-y20">预约类别</view>
<view @tap="openXial(0)" class="disjbac width100 radius10 pad-zy20 xiala posir">
<view>{{category}}</view>
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
<view class="pad-zy20 xial-item-box">
<view @tap="chooseXia(indexl)" :class="xialCurrent==indexl?'pcol pbord':''" v-for="(iteml,indexl) in xialone" :key="indexl">{{iteml.title}}</view>
</view>
</view>
</view>
</view>
<!-- <view class=" disac pad-s32">
<view class="flexs mar-y20">选择医生</view>
<view @tap="openXial(1)" class="disjbac width100 radius10 pad-zy20 xiala posir">
<view>{{categoryT}}</view>
<image :class="isZhuanT?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<view v-if="isZhuanT" class="posia bacf radius10 xial-box">
<view class="pad-zy20 xial-item-box">
<view @tap="chooseXiaT(indext)" :class="xialCT==indext?'pcol':''" v-for="(itemt,indext) in xialTwo" :key="indext">{{itemt}}</view>
</view>
</view>
</view>
</view> -->
<!-- 预约日期 -->
<view class="mar-s20 mar-x30">预约日期</view>
<scroll-view scroll-x >
<view class="disac">
<view @tap="chooseTime(index)" class="disjcac fc flexs radius20 mar-y20 yutime borbot-df" :class="item.status==0?'bcdb col3':'colc'" :style="{background:timeCurrent==index?publicColor:'',border:timeCurrent==index?`2rpx solid ${publicColor}`:''}" v-for="(item,index) in dataList" :key="index">
<view :class="timeCurrent==index?'colf':'col3'" class="bold fon28">{{item.title}}</view>
<view :class="timeCurrent==index?'colf':''" class="fon26 mar-s10">{{item.time}}</view>
</view>
</view>
</scroll-view>
<!-- 时间段 -->
<view class="mar-s20 mar-x10"> </view>
<view class="disjb fw">
<view @tap="chooseTD(indextd)" :style="{background:itemtd.tdStatus?publicColor:'',border:itemtd.tdStatus?`2rpx solid ${publicColor}`:''}" :class="itemtd.num==0?'bcdb':''" class="tc radius10 mar-x30 col3 timed borbot-df" v-for="(itemtd,indextd) in dataTD" :key="indextd">
<view :class="itemtd.tdStatus?'colf':''">{{itemtd.ttime}}</view>
</view>
</view>
<!-- 联系人 -->
<view class="disac mar-s30">
<view class="mar-y20 flexs titlel"> </view>
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
<input v-model="lname" maxlength="10" class="fon28 height-68" type="text" placeholder="请填写联系人姓名"/>
</view>
</view>
<!-- 联系方式 -->
<view class="disac mar-s20">
<view class="mar-y20 flexs titlel">联系方式</view>
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
<input v-model="lphone" maxlength="11" class="fon28 height-68" type="text" placeholder="请输入联系电话"/>
</view>
</view>
<!-- 留言信息 -->
<view class="dis mar-s20">
<view class="mar-y20 flexs mar-s20 titlel">留言信息</view>
<view class="width100 radius10 pad20 borbot-cc" style="height: 300rpx;">
<textarea v-model="lmsg" class="fon28" maxlength="500" style="height: 300rpx;width: auto;" placeholder="请填写内容"/>
</view>
</view>
<!-- 立即提交底部按钮 -->
<view @tap="submit" class="fon30 radius20 tc colf bold0 btnl" :style="{background:publicColor}">{{btnCon}}</view>
</view>
<!-- 弹框 -->
<pu-po :isShowT="isShowT" :isCenter="true" :contentVal="'提交成功!等待审核'" :comfrimVal="'好的'" @comfirmev="comfirmev"></pu-po>
</view>
<!-- 底部客服 -->
<public-customer :nright="20"></public-customer>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
timeCurrent:0,
dataList:[],//
dataTD:[],//
isShowT:false,
lname:'',//
lphone:'',//
lmsg:'',//
isZhuan:false,
xialCurrent:0,
xialone:[],
category:'',
categoryT:'',
isZhuanT:false,
xialCT:0,
xialTwo:['杨幂','周星驰'],
type_id:'',//ID
gday:'',//
dtId:[],//ID
zanTimeD:[],//
zanDay:[],//
dangId:'',//ID
btnCon:'立即提交'
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onLoad() {
this.category = this.xialone[0]
this.categoryT = this.xialTwo[0]
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkZParmas();
this.lphone = uni.getStorageSync('phone');
}
},
methods: {
gtimeD(id,gday){
this.$requst.post('user/appointment-period-full',{type_id:id,day:gday}).then(res=>{
// console.log('',res);
if(res.code==0){
this.dtId = res.data
this.dataTD = []
if(this.dtId.length!=0){
this.zanTimeD.forEach((item,index)=>{
let newNum = 1
let newTdStatus = false
this.dtId.forEach(item1=>{
if(item.id==item1.id){
newNum = 0
newTdStatus = false
}
})
let tdObj = {
id:item.id,
ttime:item.ttime,
num:newNum,
status:item.status,
tdStatus:newTdStatus
}
this.dataTD.push(tdObj)
})
} else {
this.zanTimeD.forEach(item=>{
let tdObj = {
id:item.id,
ttime:item.ttime,
num:1,
status:item.status,
tdStatus:false
}
this.dataTD.push(tdObj)
})
}
}
},error=>{})
},
checkZParmas(){//
this.$requst.post('user/appointment-parameters',{page:1,size:20}).then(res=>{
// console.log('',res);
if(res.code==0){
this.gtimeD(res.data.types[0].id,res.data.days[0].day)
//
if(res.data.types.length!=0){
res.data.types.forEach(item=>{
let ycateObj = {
id:item.id,
title:item.title,
max:item.max
}
this.xialone.push(ycateObj)
})
this.type_id = this.xialone[0].id
this.category = this.xialone[0].title
}
//
if(res.data.days.length!=0){
this.gday = res.data.days[0].day
this.zanDay = res.data.days
res.data.days.forEach(item=>{
let arr = item.day.split('-')
let newDay = arr[1]+'月'+arr[2]+'日'
let dayObj = {
title:item.week,
time:newDay,
status:item.status
}
this.dataList.push(dayObj)
})
}
//
if(res.data.times.length!=0){
res.data.times.forEach((item,index)=>{
let tdObj = {
id:item.id,
ttime:item.name,
status:item.status,
}
// this.dataTD.push(tdObj)
this.zanTimeD.push(tdObj)
})
}
}
},error=>{})
},
submit(){
if(!this.lname){
this.$toolAll.tools.showToast('请输入联系人姓名')
} else if(!this.lphone){
this.$toolAll.tools.showToast('请输入联系电话')
} else if(this.$toolAll.tools.isPhone(this.lphone)){
this.$toolAll.tools.showToast('请输入正确的联系电话')
} else if(!this.dangId){
this.$toolAll.tools.showToast('请选择时间段')
} else {
let parmas = {
type_id:this.type_id,//ID
day:this.gday,//2021-08-11
period_id:this.dangId,//ID
user_name:this.lname,//
user_phone:this.lphone,//
remarks:this.lmsg//500
}
if(this.btnCon=='立即提交'){
this.btnCon = "正在提交..."
this.$requst.post('user/appointment-apply',parmas).then(res=>{
// console.log('',res);
if(res.code==0){
this.isShowT = true
wx.requestSubscribeMessage({
tmplIds: ['uvGd7RqaegheGU-uVxR-uM3y2MadZeMOHdQaNiiWm8U'],
success: (res)=> {
console.log('res',res);
this.isShowT = true
}
})
} else {
this.btnCon = "立即提交"
this.$toolAll.tools.showToast(res.msg)
}
},error=>{})
}
}
},
comfirmev(){
this.isShowT = false
uni.navigateBack({delta:1})
},
goYu(){//
uni.navigateTo({
url:''
})
},
chooseTime(index){
if(this.dataList[index].status!=0){
this.timeCurrent = index
this.gday = this.zanDay[index].day
this.gtimeD(this.type_id,this.gday)
}
},
chooseTD(index){//
if(this.dataTD[index].num!=0){
this.dangId = this.zanTimeD[index].id
this.dataTD.forEach(item=>{//truefalse
if(item.tdStatus==true) item.tdStatus = false
})
this.dataTD[index].tdStatus = !this.dataTD[index].tdStatus
}
},
openXial(index){
if(index==0) {
this.isZhuanT = false
this.isZhuan = !this.isZhuan
}
if(index==1) {
this.isZhuan = false
this.isZhuanT = !this.isZhuanT
}
},
chooseXia(index){//
this.xialCurrent = index
this.category = this.xialone[index].title
this.type_id = this.xialone[index].id
this.gtimeD(this.type_id,this.gday)
},
chooseXiaT(index){
this.xialCT = index
this.categoryT = this.xialTwo[index]
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,292 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'购物车'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy30 pad-x160">
<view class="bacf radius20 mar-s20 pad20" v-if="cartList.length!=0">
<view class="fon28 col3 disjbac" style="height: 43rpx;">
<view class="bold">订单信息</view>
<view v-if="!cancle_del && cartList.length!=0" @tap="guanEv(0)"></view>
<view v-if="cancle_del && cartList.length!=0" @tap="guanEv(1)" class="edit-btn"> ×</view>
</view>
<view v-for="(item,index) in cartList" :key="index" class="disjbac pad-sx40 borbot posir cart-list-box" @touchstart="moveStart(index,$event)" @touchend="moveEnd">
<view class="disjbac width100" :style="{marginLeft:(showDel && isDang==index)?'-70px':'',paddingRight:(showDel && isDang==index)?'70px':''}">
<!-- -->
<view @tap="chooseItem(index)">
<image v-if="item.isActive" src="/static/public/chooseFS.png" class="flexs chooseDX" mode=""></image>
<image v-else src="/static/public/cancle-FS.png" class="flexs chooseDX" mode=""></image>
</view>
<image lazy-load @tap="chooseItem(index)" :src="item.imgSrc" class="order-image mar-z25 flexs" mode="aspectFill"></image>
<view class="width100 disjbac fc" style="height: 166rpx;">
<view class="width100">
<view @tap="goShoptDetail(item.spu_id,item.spu_activity_id)" class="fon28 col3 bold clips2">{{item.title}}</view>
<view class="order-sy">{{item.sku_name}}</view>
</view>
<view class="disjbac width100 mar-s10">
<view class="order-item-price"><span v-if="item.is_score!=1"></span><span v-else></span>{{item.price}} <span class="fon20 mar-z10" :style="{color:publicColor}" style="font-weight: 400;">{{item.mch_type_text}}</span></view>
<view class="fon26 col3 disac bold cart-input-box">
<image @tap="deladdEvent(index , 0)" src="/static/public/del.png" mode=""></image>
<input type="text" @input="inputNum($event,index)" v-model="item.num"/>
<image @tap="deladdEvent(index , 1)" src="/static/public/add.png" mode=""></image>
</view>
</view>
</view>
</view>
<view v-if="showDel && isDang==index" @tap="deltItem(index)" class="item-del-btn"></view>
</view>
</view>
<nothing-page v-if="cartList.length==0" :content="'暂无更多商品'"></nothing-page>
<view class="disjbac posixzy bacf pad-zy32" style="height: 124rpx;line-height: 124rpx;">
<view class="disac" @tap="chooseAll">
<view class="chooseAll-box">
<view v-if="isChooseAll"></view>
</view>
<view class="fon28 col3 mar-z10">全选</view>
</view>
<!-- 去支付 -->
<view v-if="!cancle_del" class="disjbac">
<view>
<view class="fon28" v-if="isScore!='score'"><span class="fon40 bold colf8">{{allPrice}}</span></view>
<view class="fon28" v-else><span class="fon40 bold colf8">{{allPrice}}</span></view>
</view>
<view @tap="goGetReadyDan" class="colf fon30 bold mar-z10 goBuy-btn" style="background: #3875F6;">{{cartList.length==0?'去购物':'去支付'}}</view>
</view>
<!-- 删除 -->
<view @tap="delBtn" v-else class="colf fon28 bold goBuy-btn" style="background: #F85050;">删除</view>
</view>
</view>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
showDel:false,
startX:'',//
endX:'',//
cancle_del:false,
cartList:[],//
isChooseAll:false,//
isDang:0,//item
newList:[],//
delIndex:[],//ID
page:1,
size:10,
isScore:'',
timeout:null
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onShow() {
uni.removeStorageSync('orderList');
uni.removeStorageSync('payType');
},
onLoad(options) {
options.isScore=='score' ? this.isScore = 'score' : ''
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkList();
}
},
computed:{
allPrice(){
let sum = 0
this.cartList.forEach(item=>{
if(item.isActive) sum += item.price*1 * item.num
})
return sum;
},
},
methods: {
//
inputNum(e,index){
clearTimeout(this.timeout);
let str = e.detail.value;
this.timeout = setTimeout(()=>{
if(str=='' || str==0){
this.cartList[index].num = 1;
}
},500)
},
checkList(){//
this.$requst.post('order/shopping-cart',{page:this.page,size:this.size,type:this.isScore}).then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let nprice = '';
item.is_score ==1 ? nprice = item.score : nprice = item.sku.sku_price/100;
let obj = {
id:item.id,
spu_id:item.spu.id,
spu_activity_id:item.spu_activity_id,//id
imgSrc:this.$http + item.spu.spu_cover,
coding:item.sku.coding,
title:item.spu_name,
sku_name:item.sku.sku_name,
price:nprice,//
num:item.num,
isActive:false,
is_score:item.is_score,//
group_id:0,//0 1 2
mch_type:item.spu.mch_type,//
mch_type_text:item.spu.mch_type_text//
}
this.cartList.push(obj)
})
}
}
})
},
deltItem(index){//
this.$requst.post('order/shopping-cart-del',{id:this.cartList[index].id}).then(res=>{
if(res.code==0){
this.cartList.splice(index,1);
this.$toolAll.tools.showToast('删除成功');
}
})
},
deladdEvent(cur,index){//
if(index==0){//
if(this.cartList[cur].num>1) this.cartList[cur].num--;
} else {//
this.cartList[cur].num++;
}
this.$requst.post('order/shopping-cart-change-num',{id:this.cartList[cur].id,num:this.cartList[cur].num}).then(res=>{})
this.zanList();
},
chooseItem(index){//
this.cartList[index].isActive = !this.cartList[index].isActive;
let one = this.cartList.filter(function(item){
return item.isActive == false;
})
one.length==0 ? this.isChooseAll = true : this.isChooseAll = false
this.zanList();
},
chooseAll(){//
this.isChooseAll = !this.isChooseAll;
this.cartList.forEach(item=>{
this.isChooseAll ? item.isActive = true : item.isActive = false;
})
this.zanList();
},
zanList(){//
this.delIndex = []
this.newList = this.cartList.filter(item=>item.isActive==true);
if(this.cancle_del){
this.cartList.filter((item,index)=>{
if(item.isActive) {
this.delIndex.push(item.id);
}
});
}
},
delBtn(){//
this.delIndex.forEach(item=>{
this.cartList.forEach((item1,index)=>{
if(item==item1.id){
this.cartList.splice(index,1);
this.$requst.post('order/shopping-cart-del',{id:item1.id}).then(res=>{
if(res.code==0){
} else {
this.$toolAll.tools.showToast(res.msg);
}
})
}
})
})
this.isChooseAll = false;
if(this.cartList.length==0){
this.cancle_del = false;
}
},
guanEv(index){//
index==0 ? this.cancle_del = true : this.cancle_del = false;
this.cartList.forEach(item=>item.isActive=false);
this.isChooseAll = false;
},
moveStart(index,e){//
this.isDang = index;
this.startX = e.touches[0].pageX
},
moveEnd(e){//
this.endX = e.changedTouches[0].pageX
if(this.startX-this.endX>0){
this.showDel = true;
} else this.showDel = false;
},
goGetReadyDan(){
let newUrl = '';
let isNei = '';
if(this.isScore=='score') {
isNei = 3
}
if(this.cartList.length == 0) {
if(isNei==3){
newUrl = '/pagesA/pointsMall/pointsMall';
} else {
newUrl = '/pages/tabbar/shop/shop';
}
uni.navigateTo({
url:newUrl
})
}
if(this.cartList.length > 0) {
// console.log(this.isAllEqual(this.newList));
if(this.isAllEqual(this.newList) || this.newList.length==1){
uni.setStorageSync('orderList',this.newList);
if(this.newList.length==0){
this.$toolAll.tools.showToast('请选择要支付的商品');
} else {
uni.setStorageSync('payType',0);
uni.navigateTo({
// url:`/pagesA/getReadyDan/getReadyDan?isNei=${isNei}`
url:`/pagesA/getReadyDan/getReadyDan-two?isNei=${isNei}`
})
}
} else {
this.$toolAll.tools.showToast('请选择相同类型的商品下单')
}
}
},
//
isAllEqual(array) {
if (array.length > 0) {
return !array.some(function(value, index) {
return value.mch_type !== array[0].mch_type;
});
} else {
return true;
}
},
goShoptDetail(id,is_activity){
// &isIntegral=${this.dataList[index].isIntegral}
if(this.isScore=='score'){
uni.navigateTo({
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=true`
})
} else {
uni.navigateTo({
url:`/pagesB/shopDetail/shopDetail?id=${id}&is_activity=${is_activity}`
})
}
}
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
</style>

146
pagesA/signIn/signIn.vue Normal file
View File

@ -0,0 +1,146 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'签到管理'" :statusTitle="true"></status-nav>
<view v-if="loading" :style="{paddingTop: statusHeight+'px'}" class=" fon28 col3">
<view style="position: sticky;z-index: 3;background: #FFFFFF;padding-bottom: 20rpx;" :style="{top:statusHeight+'px'}">
<view class="posir">
<image lazy-load class="posia width100" src="/static/public/sign-01.png" mode="widthFix"></image>
<view class="posir tc pad-sx20" style="z-index: 5;">
<image lazy-load v-if="isSigin==0" @tap="siginEv" src="/static/public/sign-02.png" mode="" class="sigin-img"></image>
<image lazy-load v-else src="/static/public/sigined.png" mode="" class="sigin-img"></image>
<view class="fon20 colf mar-s20">在连续签到可获得积分</view>
<view class="disjcac mar-sx30">
<image src="/static/public/sign-03.png" class="sigin-success" mode=""></image>
<view class="bold colf mar-z10 fon56">{{user_score}}</view>
</view>
<view class="disjb pad-zy30">
<view v-for="(item,index) in timeList" :key="index" class="disjcac fc">
<view class="disjcac fon24 posir sigin-day" :style="{color:item.isSign?'#789CFB':'#FFFFFF',background:item.isSign?'#FFFFFF':''}">
+{{item.num}}
<image v-if="item.isSign==1" class="posia" src="/static/public/gou.png" mode=""></image>
</view>
<view class="fon28 colf mar-s20">{{item.day}}</view>
</view>
</view>
</view>
</view>
<view class="mar-s20 fon28 col3 bold mar-z50">积分签到</view>
</view>
<!-- 获取列表提现列表 -->
<view class="pad-zy30">
<view class="bacf pad-zy20 pad-x20 radius20">
<scroll-view scroll-y="true" v-if="dataList.length!=0">
<view v-for="(item,index) in dataList" :key="index" class="disjbac bbot pad-sx10">
<view>
<view class="fon26 col3">{{item.title}}</view>
<view class="mar-s10 fon20 col9">{{item.time}}</view>
</view>
<view class="fon36 bold pcol">+{{item.num}}</view>
</view>
</scroll-view>
<view v-else class="fon24 col6 tc pad-s50">暂无积分签到</view>
</view>
</view>
</view>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
timeList:[],
dataList:[
// {title:'',time:'2021.09.06 10:30:10',num:'1'},
],
user_score:0,//
page:1,
size:10,
total:'',//
isZanw:true,
isSigin:0,
loading:false,
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
}
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
this.checkTime()//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000,'bottom')
this.isZanw = false
}
},
onLoad() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkTime();
this.checkList();
}
},
methods: {
siginEv(){
this.$toolAll.tools.showToast('正在签到...');
this.$requst.post('sign/online-singIn').then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('签到成功');
this.checkTime();
this.checkList();
} else {
this.$toolAll.tools.showToast(res.msg);
}
})
},
checkTime(){
this.$requst.post('sign/online-sign-record',{page:this.page,size:this.size}).then(res=>{
if(res.code==0){
if(this.page==1) this.dataList = [];
this.total = res.data.total;
if(res.data.length!=0){
res.data.forEach(item=>{
let obj = {
title:'签到积分',
time:item.created_at,
num:item.score
}
this.dataList.push(obj);
})
}
}
})
},
checkList(){
this.$requst.post('sign/mini-load').then(res=>{
if(res.code==0){
this.timeList = [];
for (let key in res.data.sign_record) {
let obj = {
num:res.data.sign_record[key].record,
day:res.data.sign_record[key].key,
isSign:res.data.sign_record[key].is_sign
}
this.timeList.push(obj)
// console.log(key);
}
this.isSigin = res.data.today_sign_in;//0 1
this.user_score = res.data.user_score;
setTimeout(()=>{
this.loading = true;
},1000)
}
})
}
}
}
</script>
<style>
page{background-color: #FFFFFF;}
</style>

View File

@ -0,0 +1,187 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'投诉与建议'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy20">
<view class="bacf mar-s25 pad-zy20 radius20 fon28 col3 pad-x40">
<!-- 问题类型 -->
<view class="disac pad-s32">
<view class="flexs mar-y20 titlel">问题类型</view>
<radio-group @change="changeCate" class="width100 disac">
<label class="radio disac">
<radio style="transform: scale(.7);" :value="2" checked color="#3875f6"/><text>改进意见/建议</text>
</label>
<label class="radio disac">
<radio style="transform: scale(.7);" :value="1" color="#3875f6"/><text>投诉</text>
</label>
</radio-group>
<!-- <radio-group @change="changeCate" class="width100 disac">
<label class="radio disac" v-for="(iteml,indexl) in xialone" :key="indexl">
<radio style="transform: scale(.7);" :value="iteml.id" :checked="indexl==0" color="#3875f6"/><text>{{iteml.title}}</text>
</label>
</radio-group> -->
<!-- 下拉列表 -->
<!-- <view @tap="openXial" class="disjbac width100 radius10 pad-zy20 xiala posir">
<view>{{category}}</view>
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
<view class="pad-zy20 xial-item-box">
<view @tap="chooseXia(indexl)" :class="xialCurrent==indexl?'pcol':''" v-for="(iteml,indexl) in xialone" :key="indexl">{{iteml.title}}</view>
</view>
</view>
</view> -->
</view>
<!-- 建议意见 -->
<view class="dis mar-s20">
<view class="mar-y20 flexs mar-s20 titlel">意见建议</view>
<view class="width100 radius10 pad20 borbot-cc" style="height: 300rpx;">
<textarea v-model="tmsg" class="fon28" maxlength="500" style="height: 300rpx;width: auto;" placeholder="请把您的意见及建议填写在这里" placeholder-style="color:#999999;"/>
</view>
</view>
<!-- 姓名 -->
<view class="disac mar-s30">
<view class="mar-y20 flexs titlel disjb">
<view></view>
<view class="mar-y10"></view>
</view>
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
<input v-model="tname" class="fon28 height-68" type="text" value="" placeholder="我们怎么称呼您" placeholder-style="color:#999999;"/>
</view>
</view>
<!-- 联系电话 -->
<view class="disac mar-s20">
<view class="mar-y20 flexs titlel">联系电话</view>
<view class="width100 radius10 pad-zy20 borbot-cc height-68">
<input v-model="tphone" maxlength="11" class="fon28 height-68" type="text" value="" placeholder="请输入联系电话" placeholder-style="color:#999999;"/>
</view>
</view>
<!-- 底部按钮 -->
<view @tap="submit" class="fon30 radius20 tc colf bold0 btnl" :style="{background:publicColor}">{{btnCon}}</view>
</view>
<!-- 弹框 -->
<pu-po :isShowT="isShowT" :isCenter="true" :contentVal="'提交成功!等待审核'" :comfrimVal="'好的'" @comfirmev="comfirmev"></pu-po>
</view>
<!-- 底部客服 -->
<!-- <public-customer :nright="20" :nbottom="100"></public-customer> -->
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
isShowT:false,
category:'',
tname:'',//
tphone:'',//
tmsg:'',//
touId:'',
isZhuan:false,
xialCurrent:0,
xialone:[],
btnCon:'立即提交',
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onLoad() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkCate();
this.tphone = uni.getStorageSync('phone');
}
},
methods: {
changeCate(e){
console.log(e.detail.value);
this.touId = e.detail.value;
},
checkCate(){
this.$requst.post('user/feedback-types').then(res=>{
// console.log('',res);
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let obj = {
id:item.id,
title:item.title
}
this.xialone.push(obj)
})
this.category = this.xialone[0].title
this.touId = this.xialone[0].id
}
}
},error=>{})
},
submit(){
if(!this.tmsg){
this.$toolAll.tools.showToast('请输入意见及建议')
} else if(this.$toolAll.tools.isPhone(this.tphone)){
this.$toolAll.tools.showToast('请输入正确的手机号')
} else {
this.eventEv();
}
},
eventEv(){
let parmas = {
type_id:this.touId,
content:this.tmsg,
user_name:this.tname,
user_phone:this.tphone
}
if(this.btnCon == '立即提交'){
// this.$toolAll.tools.showToast('...')
this.btnCon = '正在提交...'
this.$requst.post('user/add-feedback',parmas).then(res=>{
// uni.hideToast()
if(res.code==0){
this.isShowT = true
} else {
this.btnCon = '返回'
this.$toolAll.tools.showToast(res.msg)
}
},error=>{})
} else {
uni.navigateBack({delta:1})
}
},
comfirmev(){
uni.navigateBack({delta:1})
},
openXial(){
this.isZhuan = !this.isZhuan
// console.log('');
},
chooseXia(index){
this.xialCurrent = index
this.btnCon = '立即提交'
this.category = this.xialone[index].title
this.touId = this.xialone[index].id
},
}
}
</script>
<style>
</style>

205
pagesB/aboutUs/aboutUs.vue Normal file
View File

@ -0,0 +1,205 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'关于我们'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy32 pad-x180">
<!-- 自定义轮播 -->
<view class="mar-s20">
<swiper-pu :isplay="isAutoPlay" :bannerList="bannerList" :newHeight="'200'" :newRadius="'10'" :newBottom="'5'"></swiper-pu>
</view>
<!-- 导航 -->
<view class="mar-s50 pad-s10">
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" :isCenter="cateListTwo.length<=4?false:true" :newbmo="'#F5F5F5'" @choosecateEv="chooseTwo" :newcateList="cateListTwo"></cate-pu>
</view>
<!-- 列表 -->
<view v-if="dataList.length!=0" class="mar-x20">
<view @tap="goDetail(index)" class="pad-sx30 width100 disjb bbot" v-for="(item,index) in dataList" :key="index">
<view class="disjb fc">
<view class="fon30 col3 clips2" style="height: 84rpx;">{{item.title}}</view>
<view class="fon24 col9 mar-s25">{{item.time}}</view>
</view>
<image v-if="item.imgSrc!=''" class="flexs mar-z30" style="width: 140rpx;height: 140rpx;" :src="item.imgSrc" mode="aspectFill"></image>
</view>
</view>
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 20%;">
<image class="zanw-img" src="/static/public/zanwn.png" mode="aspectFill"></image>
<view class="fon24 col3">暂无内容</view>
</view>
</view>
<!-- 底部客服 -->
<!-- <public-customer :nbottom="100"></public-customer> -->
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
<!-- 底部导航 -->
<view class="posixzy">
<bottom-tab></bottom-tab>
</view>
</view>
</template>
<script>
import swiperPu from '@/components/swiper-pu.vue';
import {checkBanner} from '@/jsFile/publicAPI.js';
import bottomTab from '@/components/bottom-tab.vue';
export default {
components:{
swiperPu,
bottomTab
},
data() {
return {
cateListTwo:[
// {title:''},
// {title:''},
// {title:''},
// {title:''},
],
dataList:[
// {title:'',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
// {title:'',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
// {title:'',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
// {title:'',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
// {title:'',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
// {title:'',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
// {title:'',time:'2021-07-08 10:30',imgSrc:'/static/public/like.png'},
],
showTop:false,
newCurrent:0,
category_id:'',
page:1,
size:10,
total:'',//
isZanw:true,
bannerList:[],
isAutoPlay:false,
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
this.checkAbout(this.category_id)//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
this.isZanw = false
}
},
onShow() {
this.isAutoPlay = true;
},
onUnload() {
this.isAutoPlay = false;
},
onHide() {
this.isAutoPlay = false;
},
onLoad(options) {
this.checkSwi()
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkAbout(this.category_id)
}
},
methods: {
checkSwi(){
checkBanner({position:'about-banner'}).then(res=>{
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let isVideo = false
if(item.type!='img') isVideo = true
let haveImg = ''
if(item.src!='') haveImg = this.$http + item.src
let banObj = {
imgSrc:haveImg,
url:item.url,
isVideo:isVideo,
poster:this.$http + item.src,
}
this.bannerList.push(banObj)
})
}
//
}
})
},
checkAbout(category_id){
let params = {
category_id:category_id,
page:this.page,
size:this.size
}
this.$requst.post('archives/about',params).then(res=>{
// console.log('',res);
if(res.code==0){
if(this.cateListTwo.length==0){
if(res.data.category.length!=0){
res.data.category.forEach(item=>{
let cateObj = {
id:item.id,
mode_id:item.mode_id,
title:item.title
}
this.cateListTwo.push(cateObj)
})
}
}
if(this.page==1) this.dataList = []
if(res.data.list.list.length!=0){
this.total = res.data.list.total
res.data.list.list.forEach(item=>{
let newImg = ''
if(item.cover=='') newImg = this.appletImg;
else newImg = this.$http + item.cover
let aobj = {
id:item.id,
title:item.title,
time:item.published_at,
imgSrc:newImg
}
this.dataList.push(aobj)
})
}
}
},error=>{})
},
chooseTwo(index){//
this.newCurrent = index
console.log('二级分类:',index);
this.isZanw = true
this.page = 1
this.category_id = this.cateListTwo[index].id
this.checkAbout(this.cateListTwo[index].id)
},
goDetail(index){
uni.navigateTo({
url:'/pagesB/articleDetail/articleDetail?id='+this.dataList[index].id +"&category_id="+this.category_id
})
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,211 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'详情'" :statusTitle="true"></status-nav>
<view v-if="isLoading" :style="{paddingTop: statusHeight+'px'}" class="pad-zy32 pad-x180">
<view class="fon36 col3 bold mar-sx20" style="line-height: 50rpx;">{{detailObj.title}}</view>
<view class="disac mar-x20">
<image :src="headImg" style="width: 60rpx;height: 60rpx;border-radius: 100%;" mode="widthFix"></image>
<view class="mar-z10">
<view class="fon28 col3">{{name}}</view>
<view class="fon20 col9" style="margin-top: 6rpx;">{{detailObj.published_at}}发布</view>
</view>
</view>
<!-- 内容详情 -->
<view class="fon28" style="color: #1A1A1A; line-height: 40rpx;">
<rich-text :nodes="content"></rich-text>
</view>
<!-- 导航 -->
<view class="mar-s50 pad-s10">
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" :isCenter="cateListTwo.length<=4?false:true" :newbmo="'#F5F5F5'" @choosecateEv="chooseTwo" :newcateList="cateListTwo"></cate-pu>
</view>
<!-- 列表 -->
<view v-if="dataList.length!=0" class="mar-x20">
<view @tap="goDetail(index)" class="pad-sx30 width100 disjb bbot" v-for="(item,index) in dataList" :key="index">
<view class="disjb fc">
<view class="fon30 col3 clips2" style="height: 84rpx;">{{item.title}}</view>
<view class="fon24 col9 mar-s25">{{item.time}}</view>
</view>
<image v-if="item.imgSrc!=''" class="flexs mar-z30" style="width: 140rpx;height: 140rpx;" :src="item.imgSrc" mode="aspectFill"></image>
</view>
</view>
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 20%;">
<image class="zanw-img" src="/static/public/zanwn.png" mode="aspectFill"></image>
<view class="fon24 col3">暂无内容</view>
</view>
</view>
<view class="posixzy disjbac bacf pad-zy32 btnBKS">
<view class="posir">
<image @tap="backHome" class="posia backH" src="/static/public/back-home.png" mode="aspectFill"></image>
</view>
<view class="disac fon28 colf">
<view @tap="lianK" class="disac posir lianShare" style="background-color: #3875F6; border-top-left-radius: 51rpx;border-bottom-left-radius: 51rpx;">
<image src="/static/public/bottom-customer.png" class="mar-zy20" style="width: 47rpx;height: 47rpx;" mode="aspectFill"></image>
<view>联系客服</view>
<button class="fon24 posia" style="opacity: 0;top: 0;left: 0;right: 0;bottom: 0;" open-type="contact">客服</button>
</view>
<view class="disac posir lianShare" style="background-color: #38CE51;border-top-right-radius: 51rpx;border-bottom-right-radius: 51rpx;">
<image src="/static/public/bottom-shear.png" style="width: 47rpx;height: 47rpx;margin-left: 15rpx;margin-right: 8rpx;" mode="aspectFill"></image>
<view>分享给好友</view>
<button class="posia" open-type="share" style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button>
</view>
</view>
</view>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
headImg:'/static/public/like.png',
name:'Company',
time:'2021-07-14 08:22',
showTop:false,
detailObj:{},//
content:'',//
isLoading:false,
detailId:'',//ID
invite_code:'',
newCurrent:0,
cateListTwo:[],
dataList:[],
category_id:0,
size:10,
page:1,
total:'',//
isZanw:true,
// shareImg:''//
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
onShareAppMessage(res) {
var ya = this;
this.$requst.post('user/record',{type:'content',action:'share',id:this.detailObj.id}).then(res=>{console.log('分享成功:',res);},error=>{})
// tools.js
this.$toolAll.tools.plantPoint(4,this.detailObj.id);
var shareObj = {
     title: `${ya.detailObj.title}`, // (slogan)
     path: `/pagesB/articleDetail/articleDetail?id=${this.detailId}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
     imageUrl: `${this.$http}${this.detailObj.share_img || this.detailObj.cover}`//PNGJPG imageUrl 使 5:4
  };
  return shareObj;
},
onLoad(options) {
this.detailId = options.id
this.category_id = options.category_id
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkDetail(options.id);
this.$requst.get('index/base-config').then(res=>{
this.headImg = this.$http + res.data.logo;
this.name = res.data.logo_title;
})
}
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
this.checkAbout(this.category_id)//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
this.isZanw = false
}
},
methods: {
checkAbout(category_id){
let params = {
category_id:category_id,
page:this.page,
size:this.size
}
this.$requst.post('archives/about',params).then(res=>{
// console.log('',res);
if(res.code==0){
if(this.cateListTwo.length==0){
if(res.data.category.length!=0){
res.data.category.forEach((item,index)=>{
let cateObj = {
id:item.id,
mode_id:item.mode_id,
title:item.title
}
this.cateListTwo.push(cateObj)
if(this.category_id==item.id) this.newCurrent = index
})
}
}
if(this.page==1) this.dataList = []
if(res.data.list.list.length!=0){
this.total = res.data.list.total
res.data.list.list.forEach(item=>{
let newImg = ''
if(item.cover=='') newImg = this.appletImg;
else newImg = this.$http + item.cover
let aobj = {
id:item.id,
title:item.title,
time:item.published_at,
imgSrc:newImg
}
if(this.detailId!=item.id) this.dataList.push(aobj)
})
}
}
},error=>{})
},
chooseTwo(index){//
this.newCurrent = index
// console.log('',index);
this.isZanw = true
this.page = 1
this.category_id = this.cateListTwo[index].id
this.checkAbout(this.cateListTwo[index].id)
},
goDetail(index){
uni.navigateTo({
url:'/pagesB/articleDetail/articleDetail?id='+this.dataList[index].id +"&category_id="+this.category_id
})
},
backHome(){
uni.navigateTo({
url:'/pages/tabbar/pagehome/pagehome'
})
},
lianK(){//
this.$toolAll.tools.closeTimer()//
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
// tools.js
this.$toolAll.tools.plantPoint(5);
},
checkDetail(id){
this.$requst.post('archives/detail',{id:id}).then(res=>{
// console.log('',res);
if(res.code==0){
this.detailObj = res.data.detail;
// this.shareImg = this.$http + this.detailObj.share_img;
this.content = this.$toolAll.tools.escape2Html(res.data.detail.content)
uni.hideToast()
this.isLoading = true
}
this.checkAbout(this.category_id);
},error=>{})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,57 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'我的二维码'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy32">
<image :src="imgSrc" class="mar-s32" style="width: 100%;" mode="widthFix"></image>
<view v-if="isBtn" @tap="sendImg" class="fon40 bold colf mar-z10 radius20 tc" style="height: 90rpx;margin: 80rpx;background-color: #38CE51;line-height: 90rpx;"></view>
</view>
<!-- 底部客服 -->
<public-customer :nbottom="100"></public-customer>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import {base64ToPath} from '@/jsFile/base64-src.js';
export default {
data() {
return {
imgSrc:'',
isBtn:false
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
}
},
onLoad() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkImg()
}
},
methods: {
checkImg(){
this.$requst.post('user/service-qr').then(res=>{
// console.log('',res);
if(res.code==0){
base64ToPath(res.data.qr).then(path => {
this.imgSrc = path
this.isBtn = true
}).catch(error => {})
}
},error=>{})
},
sendImg(){
wx.showShareImageMenu({
path: this.imgSrc
})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,134 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'客服查询'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy30">
<view class="radius20 fon28 col3 mar-sx20">
<view class="disac">
<view class="disjbac width100 radius10 pad-zy20 xialak bacf">
<input class="fon28 width100" type="text" @confirm="searchEv" v-model="keyword" placeholder="客户的手机号/微信昵称查找" placeholder-style="color: #B3B3B3;" />
</view>
<view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
</view>
</view>
<!-- 列表 -->
<view class="bacf radius10 pad20 mar-x20 fon28" v-for="(item,index) in dataList" :key="index">
<view class="col3 bold disjbac">客户信息 <image :src="item.headImg" mode="aspectFill" style="width: 60rpx;height: 60rpx;border-radius: 50%;"></image></view>
<view class="mar-sx20 fon24 disjbac col6">
<text class="clips1">昵称{{item.customer_name}}</text>
<text class="flexs mar-z20"><text v-if="item.customer_phone!=''">{{item.customer_phone}}</text><text v-else></text></text>
</view>
<view class="col3 bold">绑定的客服</view>
<view v-if="item.service!=null" class="mar-s20 fon24 disjbac col6">
<text class="clips1">昵称{{item.service.name}}</text>
<text class="flexs mar-z20" v-if="item.service.phone!=''">{{item.service.phone}}</text>
</view>
<!-- <view v-else class="mar-s20 fon24 disjbac col6">
<text>昵称{{item.account.nickname}}</text>
<text><text v-if="item.account.mobile!=''">{{item.account.mobile}}</text><text v-else></text></text>
</view> -->
</view>
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 50%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<view class="fon24 col3">您搜索的内容暂无结果换个关键词试试吧</view>
</view>
<!-- 返回顶部 -->
<back-top :showTop="showTop" @backTop="backTop"></back-top>
</view>
<!-- 底部客服 -->
<public-customer :nbottom="100"></public-customer>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
dataList:[],//
showTop:false,//
keyword:'',//
page:1,
size:10,
total:'',//
isZanw:true,
ntype:'',// mine=
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
this.checkList()
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多客服数据')
this.isZanw = false
}
},
onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkList()
}
},
methods: {
searchEv(){//
if(this.keyword!='') this.ntype = ''
this.page = 1
this.isZanw = true
this.checkList()
},
checkList(){//
let params = {
page:this.page,
size:this.size,
type:this.ntype,//ID
keyword:this.keyword
}
this.$requst.post('user/get-bind-service-list',params).then(res=>{
// console.log('',res);
if(res.code==0){
if(this.page==1) this.dataList = []
this.total = res.data.total;
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let obj = {
headImg:item.headimgurl,//
id:item.account_id,
customer_name:item.nickname,
customer_phone:item.mobile,
service:item.service,
// staff:item.staff,//
// account:item.account//staff
}
this.dataList.push(obj)
})
}
}
},error=>{})
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,414 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'客户列表'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy30 pad-x20">
<view class="radius20 fon28 col3 mar-sx20">
<view class="disac">
<view @tap="openXial" class="disjbac width100 radius10 pad-zy20 xialak posir">
<view class="" style="color: #B3B3B3;">{{category}}</view>
<image :class="isZhuan?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<!-- 下拉列表 -->
<view v-if="isZhuan" class="posia bacf radius10 xial-box">
<input @tap.stop="entryEv" @confirm="searchEv" type="text" class="pad20" v-model="searchVal" placeholder="请输入昵称/姓名/手机" />
<view class="pad-zy20 xial-item-box">
<view @tap="chooseXia(indexl)" :class="xialCurrent==indexl?'pcol':''" v-for="(iteml,indexl) in xialone" :key="indexl">{{iteml.title}}</view>
</view>
</view>
</view>
<view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
</view>
</view>
<!-- 列表 -->
<view v-if="dataList.length!=0" class="dis bacf radius10 pad20 mar-x20 posir" v-for="(item,index) in dataList" :key="index">
<image lazy-load class="mar-y20 flexs" :src="item.imgSrc" style="width: 98rpx;height: 98rpx;" mode="aspectFill"></image>
<view class="fon24 col3 width100 mar-x40" style="margin-bottom: 120rpx;">
<view class="bold disjbac">
<view class="fon28 clips1">{{item.name}}</view>
<view class="flexs">来源{{item.come}}</view>
</view>
<view style="margin: 15rpx 0;" @tap="copyPhone(item.phone)">{{item.phone || ''}}</view>
<view>客服{{item.service || '暂无'}}</view>
<view class="col80 disjbac" style="margin: 15rpx 0 0 0;">
<view>{{item.time}}</view>
<view class="col3">{{item.qudao}}</view>
</view>
</view>
<!-- 真实姓名 -->
<view class="posia col3 fon24 radius10 tc disac" style="left: 20rpx;bottom: 100rpx;">
姓名
<input v-if="item.allow" :auto-focus="item.allow" type="text" v-model="realName" style="width: 100rpx;text-align: left;" />
<text v-else>{{item.real_name || ''}}</text>
<text @tap="updateName(item.id,item.real_name,index)" class="mar-z10 mar-y20 pcol flexs">{{item.updateText}}</text>
</view>
<!-- 分配客服 -->
<!-- <view @tap="fenCustomer(index)" class="posia colf fon24 radius10 tc customer-btn" style="right: 20rpx;top: 80rpx;z-index: 1;" v-if="item.customer=='' || item.customer==null" :style="{background:publicColor}"></view> -->
<view @tap="fenCustomer(index)" class="posia colf fon24 radius10 tc customer-btn" style="right: 20rpx;top: 80rpx;z-index: 1;" v-if="isFen" :style="{background:publicColor}"></view>
<!-- 设置标签 -->
<view @tap="tuneUpTag(index)" v-if="item.isTag" class="posia colf fon24 radius10 tc customer-btn" style="right: 20rpx;bottom: 20rpx;z-index: 1;" :style="{background:publicColor}"></view>
<view class="fon24 col3 posia bold disac" style="bottom: 60rpx;left: 20rpx;right: 20rpx;"><text class="flexs">标签</text>
<block v-if="item.tags.length">
<scroll-view scroll-x style="max-width: 60%;">
<view class="disac"><view v-for="(item1,tagIndex) in item.tags" :key="tagIndex" class="pcol pad-zy10 flexs">{{item1}}</view></view>
</scroll-view>
</block>
<block v-else class="col9"></block>
</view>
<view class="fon24 col3 posia clips1 bold" style="bottom: 20rpx;left: 20rpx;right: 20rpx;max-width: 70%;">详细来源{{item.source_detail}}</view>
</view>
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 50%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<view class="fon24 col3">您搜索的内容暂无结果换个关键词试试吧</view>
</view>
<!-- 分配客服弹框 -->
<pu-po :category="xialtList" @chooseXiaT="chooseXiaT" :isXiala="true" :isShowT="isShowT" :clearVal="'暂不分配'" :comfrimVal="'立即分配'" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
<!-- 设置标签弹框 -->
<!-- <pu-po :category="tagList" @chooseXiaT="chooseTag" :isXiala="true" :isTag="true" :isShowT="isShowTag" :clearVal="'暂不设置'" :comfrimVal="'立即设置'" @comfirmev="comfirmevTag" @cancleev="cancleevTag"></pu-po> -->
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
</view>
<!-- 底部客服 -->
<public-customer :nbottom="100"></public-customer>
<view v-if="isShowTag" class="disjcac posAll" @tap="closeXial">
<view class="bacf radius20 width100 tank-box">
<view class="pad-x20">
<view class="mar-s30 mar-x40 tc">请选择标签</view>
<view @tap.stop="openXia" class="disjbac radius10 pad-zy20 mar-zy20 xialak mar-x50 posir">
<view class="col3 disac width100"><input class="width100 mar-y20" disabled v-model="tagStr"></view>
<image :class="isZhuan1?'zhuan':'nozhuan'" src="/static/public/sanj.png" mode="aspectFill"></image>
<!-- 下拉列表 -->
<view v-if="isZhuan1" class="posia bacf radius10 xial-box">
<!-- 标签下拉 -->
<view class="pad-zy20 xial-item-box">
<view @tap.stop="chooseXiaTag(index)" class="disac" :class="item.checked?'pcol':''" v-for="(item,index) in tagList" :key="index">
<view v-if="" class="disac">
<checkbox style="width: 60rpx;height: 60rpx;display: inherit;" color="#3875F6" :data-id="item.id" :checked="item.checked" />
</view>
{{item.title}}
</view>
</view>
</view>
</view>
</view>
<view class="disjb fon28 colf pad-x30 pad-zy30 tc">
<view @tap="cancleevTag" class="pad-sx20 radius10 tank-btn" style="background-color: rgba(230, 230, 230,1);color: #000000;">暂不设置</view>
<view @tap="comfirmevTag" :style="{background:publicColor}" class="pad-sx20 radius10 tank-btn">立即设置</view>
</view>
</view>
</view>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
category:'',
dataList:[],
showTop:false,
isShowT:false,
isXiala:true,
isZhuan:false,
isZhuan1:false,
xialCurrent:0,
xialone:['全部'],
xialtList:[],
staff_id:'',//ID
customer_id:'',//ID
page:1,
size:10,
total:'',
isZanw:true,
ntype:'all',
tagList:[],
tag_id:'',
isShowTag:false,
tagId:'',
searchVal:'',
tagIds:[],
tagVal:[],
tagStr:'',
isFen:uni.getStorageSync('isFen'),
realName:'',//
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
this.checkCL(this.ntype)
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表数据')
this.isZanw = false
}
},
onLoad() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkKF()//
this.checkCL()//
this.checkLY()//
this.obtainTag();//
}
},
methods: {
//
updateName(id,name,index){
if(this.dataList[index].updateText=='修改'){
this.dataList.forEach(item=>item.allow=false)
this.dataList[index].allow = true;
this.dataList[index].updateText = '确认修改';
this.realName = name;
} else {
if(this.dataList[index].real_name != this.realName) {
this.$requst.post('user/update-info',{customer_id:id,field:'real_name',value:this.realName}).then(res=>{
this.$toolAll.tools.showToast('修改成功');
this.dataList.forEach(item=>item.allow=false)
this.dataList[index].updateText = '修改';
this.checkCL();
})
} else {
this.dataList.forEach(item=>item.allow=false)
this.dataList[index].updateText = '修改';
}
}
},
//
copyPhone(e){
uni.setClipboardData({
data: e,//
success:(res) => {
uni.showToast({title:'复制成功' })
}
});
},
//
closeXial(){
// this.isShowTag = false;
this.isZhuan1 = false;
},
openXia(){
this.isZhuan1 = !this.isZhuan1
},
//
chooseXiaTag(index){
let isexistence = this.tagIds.indexOf(this.tagList[index].id);
this.tagList[index].checked = !this.tagList[index].checked;
if(isexistence!=-1){
this.tagIds.splice(isexistence,1);
this.tagVal.splice(isexistence,1)
} else {
this.tagIds.push(this.tagList[index].id)
this.tagVal.push(this.tagList[index].title)
}
this.tagStr = this.tagVal.join(',');
this.tagId = this.tagIds.join(',');
//
if(this.tagIds.length==this.tagList.length){
this.isAll = true;
} else this.isAll = false;
if(!this.tagIds.length) {
this.tagStr = '请选择'
}
},
obtainTag(){//
this.$requst.post('user/tag-list').then(res=>{
// console.log('',res);
if(res.code==0){
this.tagList = [];
if(res.data.length!=0){
res.data.forEach(item=>{
let xuan = false;
let obj = {
title:item.name,
id:item.id,
checked:xuan
}
this.tagList.push(obj)
})
}
}
},error=>{})
},
//
tuneUpTag(index){
// console.log('');
this.isShowTag = true
this.tagStr = '';
this.tagId = '';
this.tagIds = [];
this.tagVal = [];
this.tagList.forEach((item,v)=>{
item.checked = false;
if(this.dataList[index].tags.length) {
this.dataList[index].tags.forEach(item1=>{
if(item.title == item1){
this.tagList[v].checked = true;
}
})
if(item.checked){
this.tagIds.push(item.id);
this.tagVal.push(item.title)
}
}
})
this.tagStr = this.tagVal.join(',');
this.tagId = this.tagIds.join(',');
//
this.customer_id = this.dataList[index].id//ID
if(this.tagList.length==0) this.tagList = ['暂无可设置的标签']
},
checkKF(){//
this.$requst.post('user/servicer-list').then(res=>{
// console.log('',res);
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let obj = {
title:item.name,
id:item.id
}
this.xialtList.push(obj)
})
this.staff_id = this.xialtList[0].id
}
}
},error=>{})
},
searchEv(){//
this.page = 1;
this.isZanw = true;
this.checkCL(this.ntype)
},
checkLY(){//
this.$requst.post('user/channel').then(res=>{
// console.log('',res);
if(res.code==0){
for (let key in res.data) {
let lyObj = {
title:res.data[key],
name:key
}
this.xialone.push(lyObj)
}
this.xialone.unshift({title:"全部",name:'all'})
this.category = this.xialone[0].title
}
},error=>{})
},
checkCL(ntype){//
this.$requst.post('user/customer',{page:this.page,size:this.size,type:ntype,keyword:this.searchVal}).then(res=>{
// console.log('',res);
if(res.code==0){
if(this.page==1) this.dataList = []
this.total = res.data.total
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let cuObj = {
id:item.id,
imgSrc:item.headimgurl,
name:item.nickname,
come:item.channel_text,
phone:item.mobile,
customer:item.service[0],
time:item.created_at,
qudao:item.tag[0],
service:item.service,
source_detail:item.source_detail,
tags:item.tag,
isTag:!item.tag.includes('员工'),
real_name:item.real_name,
allow:false,
updateText:'修改'
}
this.dataList.push(cuObj);
})
}
this.isZhuan = false;
} else this.$toolAll.tools.showToast(res.msg)
},error=>{})
},
fenCustomer(index){//
// console.log('');
this.isShowT = true
//
this.customer_id = this.dataList[index].id//ID
if(this.xialtList.length==0) this.xialtList = ['暂无可分配客服']
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
comfirmev(){//
// console.log('');
this.isShowT = false
this.$requst.post('user/customer-allot',{staff_id:this.staff_id,customer_id:this.customer_id}).then(res=>{
// console.log(':',res);
if(res.code==0){
this.page = 1
this.$toolAll.tools.showToast('分配成功')
this.checkCL(this.ntype)//
} else this.$toolAll.tools.showToast(res.msg)
},error=>{})
},
//
comfirmevTag(){
this.$toolAll.tools.showToast('设置中...')
// console.log('');
this.$requst.post('user/set-tags',{tag_ids:this.tagId,ids:this.customer_id}).then(res=>{
// console.log(':',res);
if(res.code==0){
this.page = 1
this.$toolAll.tools.showToast('设置成功')
this.obtainTag();
this.isShowTag = false
this.checkCL(this.ntype)//
} else this.$toolAll.tools.showToast(res.msg)
},error=>{})
},
cancleev(){
this.isShowT = false
},
//
cancleevTag(){
this.isShowTag = false
},
openXial(){
this.isZhuan = !this.isZhuan
this.searchVal = '';
// console.log('');
},
chooseXia(index){
this.xialCurrent = index;
this.ntype = this.xialone[index].name;
this.category = this.xialone[index].title;
},
chooseXiaT(e){
this.staff_id = e.id
},
entryEv(){
this.isXiala = true;
}
}
}
</script>
<style>
</style>

163
pagesB/doctor/doctor.vue Normal file
View File

@ -0,0 +1,163 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'医生'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy30">
<view class="radius20 fon28 col3 mar-s20">
<view class="disac">
<view class="disjbac width100 radius10 pad-zy20 xialak bacf posir">
<input @input="inputSearch" class="fon28 width100" @confirm="searchEv" type="text" v-model="keyword" placeholder="请输入问题/病种/医生姓名" placeholder-style="color: #B3B3B3;" />
<scroll-view scroll-y v-if="dataList.length && keyword!='' && isSearch" style="position: absolute; background-color: #FFFFFF;left: 0;top: 32px; max-height: 200rpx;border-radius: 10rpx;border: 1rpx solid #e0e0e0;">
<view class="pad-zy20" @tap="chooseName(item.name)" v-for="(item,index) in dataList" :key="index">{{item.name}}</view>
</scroll-view>
</view>
<view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
</view>
</view>
</view>
<view class="pad-zy20 mar-sx30 pad-x180">
<!-- 列表 -->
<view class="fon28 col3 bold qdoctor disac">全部医生</view>
<view class="mar-s30" v-if="dataList.length!=0">
<!-- 医生列表 -->
<list-doctor :list="dataList"></list-doctor>
</view>
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 50%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<view v-if="keyword!=''" class="fon24 col3"></view>
<view v-if="keyword==''" class="fon24 col3"></view>
</view>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
</view>
<!-- 底部客服 -->
<!-- <public-customer :nbottom="120"></public-customer> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
<!-- 底部导航 -->
<view class="posixzy">
<bottom-tab></bottom-tab>
</view>
</view>
</template>
<script>
import listDoctor from '@/components/list-doctor.vue';
import bottomTab from '@/components/bottom-tab.vue';
export default {
components:{
listDoctor,
bottomTab
},
data() {
return {
dataList:[
// {imgSrc:'/static/public/doctor.png',name:'',cyear:'16',bmen:'',zcheng:'',goodAt:''},
// {imgSrc:'/static/public/doctor.png',name:'',cyear:'16',bmen:'',zcheng:'',goodAt:''},
// {imgSrc:'/static/public/doctor.png',name:'',cyear:'16',bmen:'',zcheng:'',goodAt:''},
// {imgSrc:'/static/public/doctor.png',name:'',cyear:'16',bmen:'',zcheng:'',goodAt:''},
// {imgSrc:'/static/public/doctor.png',name:'',cyear:'16',bmen:'',zcheng:'',goodAt:''},
],
showTop:false,
page:1,
size:20,
total:'',//
isZanw:true,
keyword:'',
isSearch:false,
searchTime:null
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
this.checkDor()//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
this.isZanw = false
}
},
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad(options) {
this.checkDor();
},
methods: {
checkDor(){//
this.$requst.post('user/doctor-list',{page:this.page,size:this.size,keyword:this.keyword}).then(res=>{
// console.log('',res);
if(res.code==0){
if(this.page==1) this.dataList = []
if(res.data.list.length!=0){
this.total = res.data.total
res.data.list.forEach(item=>{
let newG = item.diseases
let ndeptName = ''
if(item.doctor_extra.dept_name==undefined || item.doctor_extra.dept_name=='') ndeptName = item.dept_name
else ndeptName = item.doctor_extra.dept_name
let dObj = {
id:item.id,
imgSrc:item.doctor_extra.headimg,//
name:item.doctor_extra.name,//
cyear:parseFloat(item.doctor_extra.work_time),//
bmen:ndeptName,//
zcheng:'主任医师',
goodAt:item.diseases,
show_detail:item.doctor_extra.show_detail//10
}
this.dataList.push(dObj)
})
}
}
},error=>{})
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
chooseName(name){
this.keyword = name;
this.isSearch = false;
this.checkDor();
},
inputSearch(e){
let val = e.target.value;
this.dataList = [];
clearTimeout(this.searchTime);
if(val!=''){
this.isSearch = true;
this.searchTime = setTimeout(()=>{
this.checkDor()
},500)
} else {
this.isSearch = false;
this.checkDor();
}
},
searchEv(){
this.dataList = [];
this.checkDor()
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,216 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'医生'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class=" pad-x180">
<view v-if="isLoading" class="bacf mar-s20 pad-s20 pad-x40">
<view class="pad-zy20">
<rich-text class="fon26 col3" :nodes="detailInfo"></rich-text>
</view>
</view>
<view id="daoh" :class="isTop?'isTop':''" class="isTops" :style="{top:(statusHeight-10)+'px'}">
<view class="bacf pad-zy32 mar-s20 pad-sx20">
<cate-pu :isaaaa="1" :newCurrent="newCurrent*1" :activeb="publicColor" @choosecateEv="chooseTwo" :newbmo="'#F2F2F2'" :isCenter="false" :newcateList="cateList"></cate-pu>
</view>
</view>
<view class="mar-zy32 mar-s20" v-if="dataList.length!=0"><list-pu @chooseLike="chooseLike" @praise="praiseEv" @comfirmev="comfirmev" :list="dataList"></list-pu></view>
<view style="margin-top: 8%;" v-if="dataList.length==0"><list-pu :list="dataList" @praise="praiseEv"></list-pu></view>
</view>
<!-- 底部客服 -->
<!-- <public-customer :nbottom="100"></public-customer> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
<!-- 底部导航 -->
<view class="posixzy">
<bottom-tab></bottom-tab>
</view>
</view>
</template>
<script>
import {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js';
import bottomTab from '@/components/bottom-tab.vue';
export default {
components:{
bottomTab
},
data() {
return {
cateList:[],
dataList:[],
newCurrent:0,
category_id:0,//ID
doctorObj:{},//
page:1,
size:10,
total:'',//
isZanw:true,
chuTop:'',
isTop:false,
isLoading:false,
detailInfo:'',
peopleJian:'',
doctorId:''//id
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
onShareAppMessage() {
var shareObj = {
path: `/pagesB/doctorDetail/doctorDetail?invite_code=${uni.getStorageSync('invite_code')}&doctor_id=${this.doctorId}`, // /
};
return shareObj;
},
onPageScroll(e) {
if((this.chuTop - this.statusHNH) - e.scrollTop*1 <= 0) this.isTop = true
else this.isTop = false
},
onReachBottom() {//
// console.log(this.total,this.dataList.length);
if(this.total!=this.dataList.length){
this.page++
if(this.category_id==0) this.category_id = this.cateList[0].id
this.checkConList(this.category_id)//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
this.isZanw = false
}
},
onShow() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkConList(this.category_id)
}
},
onLoad(options) {
const query = wx.createSelectorQuery()
query.select('#daoh').boundingClientRect((rect) => {
this.chuTop = rect.top
}).exec()
this.doctorId = options.doctor_id;
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.checkDoD(this.doctorId)
}
},
methods: {
chooseLike(e){//
// console.log(this.dataList[e].is_collected);
if(this.dataList[e].is_collected==0){
this.dataList[e].is_collected = 1;
this.dataList[e].collects++;
//
collectionEV({action:'collect',archive_id:this.dataList[e].id})
}
},
praiseEv(e){ //
// console.log(this.dataList[e].is_collected);
if(this.dataList[e].is_liked==0){
this.dataList[e].is_liked = 1;
this.dataList[e].likes++;
if(this.dataList[e].likes>1000) this.dataList[e].likes = '999+'
//
collectionEV({action:'like',archive_id:this.dataList[e].id})
}
},
comfirmev(e){//
this.dataList[e].is_collected = 0
this.$toolAll.tools.showToast('正在取消...','loading');
this.dataList[e].collects--;
//
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
},
checkDoD(doctor_id){
this.$requst.post('user/doctor-info',{doctor_id:doctor_id}).then(res=>{
// console.log('',res);
if(res.code==0){
this.doctorObj = res.data;
//
this.peopleJian = this.$toolAll.tools.escape2Html(this.doctorObj.doctor_extra.summary);
this.detailInfo = this.$toolAll.tools.escape2Html(this.doctorObj.doctor_extra.content);
this.isLoading = true;
}
},error=>{})
},
checkConList(category_id){//
let params = {
category_id:category_id,
page:this.page,
size:this.size
}
this.$requst.post('archives/hot',params).then(res=>{
if(res.code==0){
//
this.cateList = [];
if(res.data.category.length!=0){
res.data.category.forEach((item,index)=>{
let cateObj = {
id:item.id,//ID
title:item.title,//
active:item.active,//
model_id:item.model_id,//ID
model_name:item.model_name,//
sort:item.sort,
}
if(item.title=='日记分享') {
this.cateList.unshift(cateObj)
} else {
this.cateList.push(cateObj)
}
})
}
//
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 fabImg = '';
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl
let tObj = {
category_id:item.category_id,//ID
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:fabImg || this.appletImg,//
name:item.published_by || 'Company',//
isVideo:item.video.includes(".mp4"),//
likes:item.likes,//
is_liked:item.is_liked//
}
this.dataList.push(tObj);
})
}
}
},error=>{})
},
chooseTwo(index){
this.newCurrent = index
this.isZanw = true
this.page = 1
this.category_id = this.cateList[index].id
this.checkConList(this.category_id)
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,197 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'消息'" :whereCome="comeNum" :statusTitle="true"></status-nav>
<view id="daoh" class="bacf pad-zy30 pad-sx20 isTopf fon28 col3 disja" :style="{top:statusHeight+'px'}">
<view @tap="switchEv(true)" :class="isWen?'isWen bold':'col9'" class="posir">日程提醒</view>
<view @tap="switchEv(false)" :class="!isWen?'isWen bold':'col9'" class="posir">消息中心</view>
</view>
<!-- 列表 -->
<view :style="{paddingTop: (statusHeight+chuTop+15)+'px'}" class="pad-zy32">
<view v-if="dataList.length!=0">
<view v-for="(item,index) in dataList" :key="index">
<view class="fon24 col6 tc mar-sx50">{{item.time}}</view>
<view @tap="readMsg(index,indexl)" class="radius10 bacf pad20 mar-x20" v-for="(iteml,indexl) in item.list" :key="indexl">
<view class="disac">
<image v-if="iteml.is_read==0" class="message-img" src="/static/public/unread.png" mode=""></image>
<image v-if="iteml.is_read==1" class="message-img" src="/static/public/read.png" mode=""></image>
<view class="fon28 col3 bold mar-zy10">{{iteml.title}}</view>
<view :style="{background:iteml.is_read==1?'rgba(204, 204, 204,1)':'#FF4D4D'}" class="message-status">{{iteml.is_read==1?'已读':'未读'}}</view>
</view>
<view v-if="iteml.content!=''" class="fon26 col3 mar-s20">{{iteml.content}}</view>
</view>
</view>
</view>
<view v-else class="disjcac fc" style="margin-top: 50%;">
<image src="/static/public/nothingm.png" style="width: 474rpx;height: 273rpx;" mode="aspectFill"></image>
<view class="fon24 col3">暂无消息</view>
</view>
</view>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 底部客服 -->
<public-customer :nbottom="100"></public-customer>
</view>
</template>
<script>
export default {
data() {
return {
searchVal:'',//
dataList:[],
showTop:false,//
chuTop:'',
isWen:true,
page:1,
size:10,
total:0,
isZanw:true,
ntype:'reminders',//
comeNum:0
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {
if(this.total!=this.dataList.length){
this.page++
this.checkMsg()//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多消息','none',1000)
this.isZanw = false
}
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
},
onLoad(options) {
//
if(options.comeNum==undefined) this.comeNum = 2;
const query = wx.createSelectorQuery()
query.select('#daoh').boundingClientRect((rect) => {
// console.log('+',rect);
this.chuTop = rect.height
}).exec()
if(options.index==undefined){this.isWen = false;this.ntype = 'message';}
this.checkMsg();
let that = this ;
wx.showModal({
title: '温馨提示',
content: '为及时通知到您,需要向您申请消息发送权限,不会骚扰您的生活!',
confirmText:"同意",
cancelText:"拒绝",
success: function (res) {
if (res.confirm) {
//
console.log('用户点击确定', '订阅消息授权成功');
//
wx.requestSubscribeMessage({
tmplIds: ['d0efR-Ga27c6eIvx9mAwJcnAqzhM_Sq68XiFvjvlBJM','eyxvInLLF3L_wmcSQc_O7XLKF7RoGK1dM3OwKj5fHio'],
success: (res) => {
console.log(res, 'success')
},
fail: (res) => {
console.log(res, 'fail')
},
complete: (res) => {
wx.getSetting({
withSubscriptions: true,
success: (res) => {
console.log(res, '获取设置信息')
}
})
console.log(res, 'complete')
}
})
} else if (res.cancel) {
console.log('用户点击取消', '订阅消息授权');
///
wx.showModal({
title: '温馨提示',
content: '拒绝后您将无法获得及时的消息通知哦',
confirmText:"知道了",
showCancel:false,
success: function (res) {
///
///
}
});
}
}
});
},
methods: {
readMsg(index1,index2){
this.dataList[index1].list[index2].is_read = 1;
},
checkMsg(){
this.$requst.post('user/messages',{page:this.page,size:this.size,type:this.ntype}).then(res=>{
// console.log('',res);
if(res.code==0){
if(this.page==1) this.dataList = [];
this.total = res.data.total;
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let titleMsg = '';
if(item.type=='notice') titleMsg = "通知";
if(item.type=='system') titleMsg = "系统消息";
let msgObj = {
time:item.send_at,
list:[
{
is_read:item.is_read,
title:titleMsg,
content:item.content,
}
]
}
this.dataList.push(msgObj)
})
}
}
},error=>{})
},
switchEv(flag){
this.isWen = flag;
this.isZanw = true;
this.page = 1;
if(flag){
this.ntype = 'reminders';
this.checkMsg();
} else {
this.ntype = 'message';
this.checkMsg();
}
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
.isWen{color: #3875F6;}
.isWen::after{
content: '';
display: block;
height: 8rpx;
width: 80%;
position: absolute;
bottom: -20rpx;
left: 50%;
transform: translateX(-50%);
background: #3875F6;
}
</style>

View File

@ -0,0 +1,424 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'收藏'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view>
<view id="daoh" class="bacf pad-zy30 pad-sx20 isTopf fon28 col3 disja" :style="{top:statusHeight+'px'}">
<view @tap="shopCollection(0)" :class="isWen?'isWen':''" class="posir">文章收藏</view>
<view @tap="shopCollection(1)" :class="!isWen?'isWen':''" class="posir">商品收藏</view>
</view>
<view :style="{paddingTop:(statusHeight+chuTop+15)+'px'}">
<view v-if="isWen">
<view class="pad-zy32 mar-x20">
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" :isCenter="false" :newbmo="'#F2F2F2'" @choosecateEv="chooseTwo" :newcateList="cateList"></cate-pu>
</view>
<view v-if="dataList.length!=0" class="pad-zy20 pad-s20">
<list-pu @comfirmev="comfirmev" @praise="praiseEv" :list="dataList"></list-pu>
</view>
<view v-else class="disjcac fc" style="margin-top: 40%;">
<image class="zanw-img" src="/static/public/collection.png" style="" mode="aspectFill"></image>
<view class="fon24 col3">您还没有收藏快去收藏吧</view>
</view>
</view>
<view v-else>
<view v-if="shopList.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 shopList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn posir" @tap="goPage(item1.id,index1)">
<image lazy-load :src="item1.imgSrc" mode="aspectFill" style="width: 100%;border-top-left-radius: 15rpx;border-top-right-radius: 15rpx;height: 325rpx;"></image>
<view class="posia list-like-box" @tap.stop="chooseLike(index1)">
<image class="animated" src="/static/public/like.png" mode="aspectFill"></image>
</view>
<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 lazy-load 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 shopList" :key="index1" class="bacf radius15 mar-x20 animated fadeIn posir" @tap="goPage(item1.id,index1)">
<image lazy-load :src="item1.imgSrc" mode="aspectFill" style="width: 100%;border-top-left-radius: 15rpx;border-top-right-radius: 15rpx;height: 325rpx;"></image>
<view class="posia list-like-box" @tap.stop="chooseLike(index1)">
<image class="animated" src="/static/public/like.png" mode="aspectFill"></image>
</view>
<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 lazy-load 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" 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>
<view v-else class="disjcac fc" style="margin-top: 50%;">
<image class="zanw-img" src="/static/public/collection.png" style="" mode="aspectFill"></image>
<view class="fon24 col3">您还没有收藏快去收藏吧</view>
</view>
</view>
</view>
</view>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 底部客服 -->
<public-customer :nbottom="100"></public-customer>
</view>
</template>
<script>
import {cancleCollectionEV,cancleCollectionShopEV} from '@/jsFile/publicAPI.js';
import shopList from '@/components/shop-list.vue';
export default {
components:{
shopList
},
data() {
return {
dataList:[],
showTop:false,//
newCurrent:0,
cateList:[//
],
isZanw:true,
category_id:0,//ID
chuTop:'',
isWen:true,
shopList:[],
activeIndex:0,
isShowT:false,
pu_content:'是否需要取消收藏?',
page:1,
size:10,
total:'',//
timeList:[],//
collectionTime:null
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
this.checkConList(this.category_id)//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
this.isZanw = false
}
},
onUnload() {
uni.removeStorageSync('cateList');
clearInterval(this.collectionTime);
},
onHide() {
clearInterval(this.collectionTime);
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
this.checkConList(this.category_id);
this.shopCollection();
},
onLoad(options) {
const query = wx.createSelectorQuery()
query.select('#daoh').boundingClientRect((rect) => {
// console.log('+',rect);
this.chuTop = rect.height
}).exec()
},
methods: {
praiseEv(e){ //
// console.log(this.dataList[e].is_collected);
if(this.dataList[e].is_liked==0){
this.dataList[e].is_liked = 1;
this.dataList[e].likes++;
if(this.dataList[e].likes>1000) this.dataList[e].likes = '999+'
//
collectionEV({action:'like',archive_id:this.dataList[e].id})
}
},
shopCollection(index){//
clearInterval(this.collectionTime);
if(index==1){
this.isWen = false;
uni.request({
url:`${getApp().globalData.hostApi}spu/collection`,
data:{page:this.page,size:this.size},
method:'post',
header:{
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: (res) => {
if(res.data.code==0){
this.shopList = [];
let nArr = [];
if(res.data.data.list.length!=0){
res.data.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)
group_cover.push(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
reponseTime:res.header.Date,//
activity_end_at:item.activity_end_at,//
activity_group_cover:group_cover,//
activity_group_num:item.activity_group_num,//
}
nArr.push(obj)
})
this.loading = true;
}
nArr.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.collectionTime = setInterval(()=>{//
if(this.timeList.length!=0){
this.timeList.forEach((item,index)=>{
console.log(item.id,nArr[item.nIndex].id);
if(item.id==nArr[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
nArr[item.nIndex].activity_end_at = "活动已结束";
} else {
//
nArr[item.nIndex].activity_end_at = this.$toolAll.tools.dayTime(this.timeList[index].time,this.timeList[index].reponseTime);
}
}
})
}
},1000)
setTimeout(()=>{
this.shopList = nArr;
},1000)
} else {
this.shopList = nArr;
}
}
}
})
} else {
this.isWen = true;
}
},
checkConList(category_id){//
// this.$toolAll.tools.showToast('...')
let params = {
category_id:category_id,
page:this.page,
size:this.size
}
this.$requst.post('archives/collects',params).then(res=>{
if(res.code==0){
//
if(uni.getStorageSync('cateList')==''){//
if(res.data.category.length!=0){
res.data.category.forEach((item,index)=>{
let cateObj = {
id:item.id,//ID
title:item.title,//
active:item.active,//
model_id:item.model_id,//ID
model_name:item.model_name,//
sort:item.sort,
}
this.cateList.push(cateObj)
})
uni.setStorageSync('cateList',this.cateList)
this.category_id = this.cateList[0].id
}
} else {
//
this.cateList = uni.getStorageSync('cateList')
}
//
if(this.page==1) this.dataList = []
this.total = res.data.list.total
if(res.data.list.list.length!=0){
uni.hideToast()
res.data.list.list.forEach(item=>{
let fabImg = '';
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
let tObj = {
category_id:item.category_id,//ID
id:item.id,
is_collected:1,//
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: fabImg || this.appletImg,//
name:item.published_by || 'Company',//
isVideo:item.video.includes(".mp4"),//
likes:item.likes,//
is_liked:item.is_liked//
}
this.dataList.push(tObj);
})
}
}
},error=>{})
},
comfirmev(e){//
this.$toolAll.tools.showToast('正在取消...','loading')
//
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
setTimeout(()=>{
this.checkConList(this.category_id)
},300)
this.dataList[e].is_collected = 0
},
chooseLike(index){
this.activeIndex = index;
this.isShowT = true;
},
submitQu(){
this.$toolAll.tools.showToast('正在取消...','loading');
//
cancleCollectionShopEV({action:'collect',id:this.shopList[this.activeIndex].id});
this.isShowT = false;
this.shopList.splice(this.activeIndex,1);
// this.shopCollection();
},
chooseTwo(index){//
this.newCurrent = index
this.isZanw = true
this.page = 1
this.category_id = this.cateList[index].id
this.checkConList(this.cateList[index].id)
// console.log('',index);
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
goPage(id,index){//
uni.navigateTo({
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.shopList[index].isIntegral}`
})
}
}
}
</script>
<style>
.isWen{color: #3875F6;}
.isWen::after{
content: '';
display: block;
height: 4rpx;
width: 100%;
position: absolute;
bottom: -20rpx;
background: #3875F6;
}
</style>

View File

@ -0,0 +1,143 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'我的分享人'" :statusTitle="true"></status-nav>
<view class="bacf posiszy navHeight" :style="{paddingTop: statusHeight+'px'}">
<view class="disja pad-sx30">
<view @tap="chooseye(indexye)" :style="{color:flag==indexye?publicColor:''}" v-for="(itemye,indexye) in cateList" :key="indexye">{{itemye.title}}({{itemye.num}})</view>
</view>
</view>
<view :style="{paddingTop: (statusHeight*1+53)+'px'}">
<view v-if="dataList[flag].length!=0">
<view class="disjbac bbot pad-sx40 mar-zy50" v-for="(iteml,indexl) in dataList[flag]" :key="indexl">
<view class="disac">
<!-- 头像 -->
<image class="radius20" :src="iteml.src" style="width: 100rpx;height: 100rpx;" mode="aspectFill"></image>
<view class="mar-z25">
<!-- 昵称 -->
<view class="fon32 bold">{{iteml.name}}</view>
<!-- 时间 -->
<view class="fon24 col80 mar-s10">{{iteml.time}}</view>
</view>
</view>
<view class="tright">
<!-- 方式 -->
<view class="fon24 col80">{{iteml.action}}</view>
<!-- 收益 -->
<view class="fon28 bold mar-s10" style="color: #EB5929;">+{{iteml.num}}</view>
</view>
</view>
</view>
<view v-else class="disjcac fc" style="margin-top: 40%;">
<image src="/static/public/nothing.png" style="width: 474rpx;height: 273rpx;" mode="aspectFill"></image>
<view class="fon24 col3">您还没有分享人快去分享吧</view>
</view>
</view>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 底部客服 -->
<public-customer :nbottom="100"></public-customer>
</view>
</template>
<script>
export default {
data() {
return {
flag:0,
cateList:[
{title:'一级',num:0,grade:'first'},
{title:'二级',num:0,grade:'second'},
],
showTop:false,//
dataList:[
[],
[],
],
page:1,
size:20,
total:'',//
isZanw:true,
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//
if(this.total!=this.dataList[this.flag].length){
this.page++
this.checkPeople()
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多分享人','none',1000)
this.isZanw = false
}
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
},
onLoad(options) {
this.checkShare()//
this.checkPeople()//
},
methods: {
checkShare(){//
this.$requst.post('user/share-count').then(res=>{
// console.log('',res);
if(res.code==0){
this.cateList[0].num = res.data.user_count.first
this.cateList[1].num = res.data.user_count.second
}
})
},
checkPeople(){//
this.$requst.post('user/share-users',{grade:this.cateList[this.flag].grade,page:this.page,size:this.size}).then(res=>{
if(this.flag){
if(this.page==1) this.dataList[1] = [];
} else {
if(this.page==1) this.dataList[0] = [];
}
if(res.code==0){
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let obj = {
src:item.headimgurl,
name:item.nickname,
time:item.created_at,
action:item.invite_source,
num:item.score
}
this.dataList[this.flag].push(obj)
})
this.total = res.data.total
}
}
})
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
chooseye(index){
this.page = 1;
this.flag = index;
this.checkPeople();
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,342 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'订单详情'" :statusTitle="true"></status-nav>
<view :style="{paddingTop: statusHeight+'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>
<view v-if="orderInfo.status=='waiting'" class="colf8 bold">{{orderInfo.status_text}}</view>
<view v-if="orderInfo.status=='paid' && orderInfo.has_virtual!=1" class="colf8 bold">{{orderInfo.status_text}}</view>
<view v-if="orderInfo.status=='shipped' && orderInfo.has_virtual!=1" class="colf8 bold">{{orderInfo.status_text}}</view>
<view v-if="orderInfo.status=='completed'" class="col9 bold">{{orderInfo.status_text}}</view>
<view v-if="orderInfo.virtual_check==0 && orderInfo.has_virtual==1" class="colf8 bold">{{orderInfo.status_text}}</view>
<view v-if="orderInfo.virtual_check==1 && orderInfo.has_virtual==1" class="col9 bold">{{orderInfo.status_text}}</view>
<view v-if="orderInfo.status=='closed'" class="col9 bold">{{orderInfo.status_text}}</view>
</view>
<view class="bold col3 mar-s40 mar-x20">订单号{{orderInfo.coding}}</view>
<view class="fon24 col9" v-if="orderInfo.is_only==0 && orderInfo.open_one==1 && orderInfo.is_group_make==1 && orderInfo.open_one_success==0 ">{{daoTime}}</view>
<view class="fon24 col9" v-else>{{orderInfo.created_at}}</view>
</view>
<!-- 物流信息 -->
<view class="bacf radius20 mar-s20 fon28" style="padding: 27rpx 20rpx;">
<view class="bold">物流信息</view>
<view class="bold col3 mar-s40 fon26 disjbac">
<view>{{orderInfo.express_name}}{{orderInfo.express_number||'暂无快递单号'}}</view>
<view @tap="copyCont"></view>
</view>
</view>
<!-- 地址信息 -->
<view v-if="orderInfo.address!='自提'" class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
<view class="bold">收件人信息</view>
<view class="fon26 col3">
<view class="fon28 col3 bold" style="margin: 52rpx 0 20rpx 0;">{{addressInfo.userName}}<span class="mar-z10">{{addressInfo.userPhone}}</span></view>
<view class="fon24 col9">{{addressInfo.userAddress}}</view>
</view>
</view>
<view v-else class="bacf radius20 mar-s20" style="padding: 27rpx 20rpx;">
<view class="bold">商家地址信息</view>
<view class="fon26 col3 disjbac mar-s30">
<view>
<view class="fon28 col3 bold mar-x20">Company</view>
<view class="fon24 col9">{{goAddress}}</view>
</view>
<!-- 立即导航 -->
<image @tap="goThere(goAddress)" src="/static/public/daoh.png" class="there" mode="aspectFill"></image>
</view>
</view>
<!-- 订单信息 -->
<view class="bacf radius20 mar-s20 orderDetail-box">
<view v-for="(item,index) in orderInfo.skus" :key="index" class="fon26 col3 disjbac pad-sx50 disjbac bbot">
<image :src="item.spu_cover" class="flexs" mode="aspectFill"></image>
<view class="width100">
<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><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 && item.check_type=='frontend'" class="order-btn">线</view>
<view v-if="orderInfo.virtual_check==0 && orderInfo.has_virtual==1 && item.check_type!='frontend'" class="order-btn" style="background-color: #CCCCCC;">线</view>
</view>
</view>
</view>
<view class="fon28 disjbac mar-s40 mar-x20">
<view class="col6">{{allNum}}</view>
<view class="colf8 bold">共计{{allPrice}}</view>
</view>
</view>
<!-- 快递费用 -->
<view v-if="isExpress" class="bacf radius20 mar-s20 disjbac pad-sx27-zy20">
<view class="bold">快递费用</view>
<view class="fon28 colf8 bold">{{orderInfo.freight}}.00</view>
</view>
<!-- 消费 -->
<view class="fon28 col3 consumption-box">消费<span class="fon36 bold colf8"><span v-if="orderInfo.is_score==0">{{orderInfo.price/100}}</span><span v-else>{{orderInfo.score}}</span> <span v-if="orderInfo.coin!=0">+{{orderInfo.coin}}</span></span></view>
<view class="disjbac posixzy bacf orderDetail-bottom-box">
<view class="posir">
<image src="/static/public/weix.png" mode=""></image>
<view class="fon28 col3">分享</view>
<button open-type="share"
:data-title="orderInfo.skus[0].spu_name"
:data-is_activity="orderInfo.skus[0].is_activity"
:data-imgsrc="orderInfo.skus[0].spu_cover"
:data-id="orderInfo.skus[0].spu_activity_id || orderInfo.skus[0].sku_id"
class="posia-op"></button>
</view>
<view @tap="comeing(orderInfo.coding)" v-if="orderInfo.is_only==0 && orderInfo.open_one==1 && orderInfo.is_group_make==1 && orderInfo.open_one_success==0 " class="orderInfo-btn"></view>
<!-- 待付款 -->
<view class="disac paid-btn-box" v-if="orderInfo.status=='waiting'">
<view @tap="cancleEv"></view>
<view @tap="paymentEv"></view>
</view>
<!-- 待发货 -->
<view class="disac paid-btn-box" v-if="orderInfo.status=='paid' && orderInfo.virtual_check==0">
<view @tap="cancleEv"></view>
</view>
<!-- 确认收货 -->
<view @tap="confirmReceipt(orderInfo.id)" 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;" catchtouchmove="return">
<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="closeEv" 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 {
loading:false,
isExpress:true,
switchQuan:true,
showQuan:false,
express:'韵达快递2983625984729',
orderInfo:'',//
addressInfo:'',//
allPrice:0,//
allNum:0,//
times:0,//
goAddress:'四川省成都市成华区双店路B口',
isHeyan:false,
canvasQrPath: '',
text: 'hello',
size: 162,
colorDark: '#000000',
colorLight: '#ffffff',
timer:null,
daoTime:'',
timerDao:null,
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
}
},
onShareAppMessage(res) {
var shareObj = {
     title: res.target.dataset.title, // (slogan)
     path: `/pagesB/shopDetail/shopDetail?id=${res.target.dataset.id}&category_id=0&is_activity=${res.target.dataset.is_activity}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
     imageUrl: res.target.dataset.imgsrc//PNGJPG imageUrl 使 5:4
  };
  return shareObj;
//   return false;
},
onUnload() {
this.closeEv();
},
onShow() {
//
this.$toolAll.tools.disableShareEv();
},
onLoad(options) {
this.checkInfo(options.id);
},
methods: {
comeing(coding){
this.$requst.post('user/open-one',{order_coding:coding}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('免拼成功');
this.checkInfo(this.orderInfo.id);
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},
confirmReceipt(id){//
this.$requst.post('order/accepted',{order_id:id}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('收货成功');
this.checkInfo(this.orderInfo.id);
} else this.$toolAll.tools.showToast(res.msg);
}).catch(error=>{this.$toolAll.tools.showToast(error.msg);})
},
make(index){
this.isHeyan = true;
this.text = `${this.orderInfo.coding}H${this.orderInfo.skus[index].id}`;
let params = {
order_coding:this.orderInfo.coding,
id:this.orderInfo.skus[index].id,
not_check_num:this.orderInfo.skus[index].not_check_num
}
this.timer = setInterval(()=>{
this.$requst.post('order/check-result',params).then(res=>{
if(res.code==0){
if(res.data.result==1){
this.isHeyan = false;
this.$toolAll.tools.showToast('已完成');
this.checkInfo(this.orderInfo.id);
clearInterval(this.timer);
}
} else this.$toolAll.tools.showToast(res.msg);
}).catch(error=>{this.$toolAll.tools.showToast(error.msg);})
},3000)
},
closeEv(){
this.isHeyan = false;
clearInterval(this.timer);
clearInterval(this.timerDao);
},
cancleEv(){//
this.times++;
if(this.times==2){
this.$requst.post('order/cancel',{order_coding:this.orderInfo.coding}).then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('取消订单成功');
this.checkInfo(this.orderInfo.id);
this.times = 0;
} else this.$toolAll.tools.showToast(res.msg);
}).catch(error=>{this.$toolAll.tools.showToast(error.msg);})
} else {
setTimeout(()=>{
this.times = 0;
},1500)
this.$toolAll.tools.showToast('双击即可取消订单');
}
},
paymentEv(){//
if(this.times==0){
this.$toolAll.tools.showToast('正在调起支付','loading',1500)
this.times++;
this.$requst.post('order/pay',{order_coding:this.orderInfo.coding}).then(res=>{
if(res.code==0){
uni.requestPayment({
provider: 'wxpay',
appId:res.data.payment_params.appId,//appId
timeStamp: res.data.payment_params.timeStamp,//
nonceStr: res.data.payment_params.nonceStr,//
package: res.data.payment_params.package,//package
signType: res.data.payment_params.signType,//MD5
paySign: res.data.payment_params.sign,//
success:(res)=> {
this.$requst.post('order/paid',{order_coding:this.orderInfo.coding}).then(res=>{
if(res.code==0){
this.times = 0;
this.$toolAll.tools.showToast('支付成功');
this.checkInfo(this.orderInfo.id);
} else this.$toolAll.tools.showToast(res.msg);
})
}
});
} else this.$toolAll.tools.showToast(res.msg);
}).catch(error=>{this.$toolAll.tools.showToast(error.msg);})
}
},
checkInfo(id){//
this.$requst.post('user/order-detail',{id:id}).then(res=>{
if(res.code==0){
this.allPrice = 0;
this.allNum = 0;
let narr = res.data;
narr.skus.forEach(item=>{
item.spu_cover = this.$http + item.spu_cover;
//
if(narr.is_score==0){
this.allPrice += item.price*item.num;
} else {
this.allPrice += item.score*item.num;
}
this.allNum += item.num;
})
if(narr.is_score==0){//
this.allPrice = this.allPrice/100;
} else {//
this.allPrice = this.allPrice;
}
this.orderInfo = narr;
if(this.orderInfo.group_make_end_at!=null){
this.daoTime = this.$toolAll.tools.dayTime(this.orderInfo.group_make_end_at,new Date().getTime());
this.timerDao = setInterval(()=>{
if(new Date().getTime()-new Date().getTime(this.orderInfo.group_make_end_at)>0){
this.checkInfo(this.orderInfo.id);
clearInterval(this.timerDao)
} else {
this.daoTime = this.$toolAll.tools.dayTime(this.orderInfo.group_make_end_at,new Date().getTime());
}
},1000)
}
let naddress = this.orderInfo.address.split(',');
if(naddress[0]!='自提'){
let nphone = this.$toolAll.tools.hideMPhone(naddress[1].trim())
this.addressInfo = {
userName:naddress[0].trim(),
userPhone:nphone,
userAddress:naddress[2].trim()
}
}
this.loading = true;
} else this.$toolAll.tools.showToast(res.msg);
}).catch(error=>{this.$toolAll.tools.showToast(error.msg);})
},
copyCont(){//
if(this.times==0){
this.times++;
if(this.orderInfo.express_number!=null){
this.$toolAll.tools.clickCopy(this.orderInfo.express_number);
this.$toolAll.tools.showToast('复制快递单号成功');
} else this.$toolAll.tools.showToast('暂无可查询的快递信息');
setTimeout(()=>{
this.times = 0;
},2000)
}
},
goThere(val){//
wx.getLocation({//
type: 'wgs84', //wx.openLocationbug: iOS 6.3.30 type wgs84
success: function (res) {
wx.openLocation({//使
latitude: getApp().globalData.latitude,//-
longitude: getApp().globalData.longitude,//-
name: val,
address: val
})
}
})
},
}
}
</script>
<style>
page {
background-color: #F5F5F5;
}
</style>

View File

@ -0,0 +1,151 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'二维码海报'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy20 pad-x180">
<view class="tc mar-s20 col6 fon28">请选择海报背景后分享</view>
<view v-if="imgList.length!=0">
<view class="mar-s20 disjbac fw">
<image lazy-load @tap="chooseImg(index)" v-for="(item,index) in imgList" :key="index" class="width100 radius20 mar-x20" :src="item" style="width: 48.5%;max-height: 474rpx" mode="aspectFill" lazy-load></image>
</view>
</view>
<view v-else class="disjcac fc" style="margin-top: 50%;">
<image class="zanw-img mar-x50" src="/static/public/zanwn.png" mode="aspectFill"></image>
<view class="fon24 col3 mar-s50" style="margin-top: 30%;">暂无内容</view>
</view>
<!-- 预览弹框 -->
<view v-if="showBtn" @tap.stop="showBtn=false" class="posAll disjcac fc pad-zy50" style="z-index: 11;">
<image lazy-load :src="imgSrc" @tap.stop="showBtn=true" class="radius20" style="width: 80%;" mode="widthFix"></image>
<!-- 分享按钮 -->
<view @tap.stop="shareEv" class="disjcac radius20 posixzy" style="height: 90rpx;margin: 20rpx 80rpx;background-color: #38CE51;line-height: 90rpx;bottom: 40rpx;">
<view class="disac">
<image src="/static/public/sharef.png" style="width: 54rpx;height: 54rpx;" mode=""></image>
<view class="fon40 bold colf mar-z10">分享给好友</view>
</view>
</view>
</view>
</view>
<!-- 弹框 -->
<pu-po :isShowT="imgList.length==0 && isHaib" :contentVal="'立即生成创意海报'" :clearVal="'暂不生成'" :comfrimVal="'立即生成'" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
<!-- 底部客服 -->
<!-- <public-customer :nbottom="100"></public-customer> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="tabimgList" :newcurrent='-1'></foot-tab>
</view>
</template>
<script>
import {base64ToPath} from '@/jsFile/base64-src.js';
export default {
data() {
return {
isShowT:true,
imgList:uni.getStorageSync('imgSrcList'),
imgSrc:'',
showBtn:false,
isHaib:false,
shareFlag:true//
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
tabimgList() {
return this.$store.state.imgList
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
//
if(uni.getStorageSync('imgSrcList')!='') this.imgSrcList = uni.getStorageSync('imgSrcList')//
else this.imgList = []
this.checkPoster();
}
},
methods: {
checkPoster(){//
this.$requst.get('user/poster').then(res=>{
if(res.code==0){
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
this.imgList.push(this.$http + item);
})
}
} else this.$toolAll.tools.showToast(res.msg);
},error=>{this.$toolAll.tools.showToast(error.msg);})
},
chooseImg(index){//
this.imgSrc = '';
this.showBtn = true;
this.$toolAll.tools.showToast('正在生成海报...','loading',10000);
this.$requst.post('user/poster-info',{poster_src:this.imgList[index]}).then(res=>{
if(res.code==0){
base64ToPath(res.data.poster).then(path => {
this.imgSrc = path;
uni.setStorageSync('imgSrcP',path);
}).catch(error => {})
this.$toolAll.tools.showToast('海报生成成功','none',1500);
} else {
this.$toolAll.tools.showToast('海报生成失败','none',1500);
this.showBtn = false;
}
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},
shareEv(){
this.$toolAll.tools.showToast('正在调起分享...');
if(this.shareFlag){
this.shareFlag = false;
wx.showShareImageMenu({
path: this.imgSrc,
success:(res=>{
this.shareFlag = true;
this.$requst.post('user/record',{type:'other',action:'share',id:''}).then(res=>{console.log('分享成功:',res);},error=>{})
// tools.js
this.$toolAll.tools.plantPoint(4);
}),
fail:(err=>{
this.shareFlag = true;
})
})
} else {this.$toolAll.tools.showToast('请勿重复点击');}
},
comfirmev(){//
this.$toolAll.tools.showToast('生成中...')
this.isShowT = false
//
this.$requst.get('user/personal-poster').then(res=>{
// console.log('',res);
if(res.code==0){
let newArr = [];
newArr.push(res.data.poster)
uni.hideToast()
newArr.forEach(item=>{
base64ToPath(item).then(path => {
this.imgList.push(path)
uni.setStorageSync('imgSrcList',this.imgList)
}).catch(error => {})
})
this.$toolAll.tools.showToast('生成海报成功');
this.isHaib = false
} else this.$toolAll.tools.showToast(res.msg);
},error=>{this.$toolAll.tools.showToast(error.msg);})
},
cancleev(){//
uni.navigateBack({delta:1})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,559 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav v-if="invite_code==''" :titleVal="'分类'" :statusTitle="true"></status-nav>
<view v-if="invite_code!=''" class="status-box statusHNH" style="background-color: #FFFFFF;">
<view :style="{height:statusBarHeight+'px'}"></view>
<view class="status-nav">
<!-- 标题 -->
<view class="tab-title tcenter" style="color: #000000;">分类</view>
</view>
</view>
<!-- 列表 -->
<view :style="{top: statusHeight+'px'}" class="posiszy" style="height: 50px;">
<view class="bacf pad-zy32 pad-sx20">
<cate-pu @choosecateEv="choosecateEv" :activeb="invite_code!=''?'#3875F6':publicColor"
:newCurrent="cateCurrent*1" :newbmo="'#F2F2F2'" :isCenter="false" :newcateList="cateList"></cate-pu>
</view>
</view>
<view class="pad-x180" :style="{paddingTop: (statusHeight+50)+'px'}">
<view v-if="isLoading" class="pad-s30">
<view v-show="cateCurrent==isNum">
<view class="pad-zy32">
<!-- 自定义轮播 -->
<swiper-pu v-if="ifSwiper" :browseP="true" :isplay="isAutoPlay" :bannerList="bannerList" :newHeight="newHeight"
:newRadius="'10'" :newBottom="'5'"></swiper-pu>
<!-- 标题 -->
<view class="fon36 col3 bold mar-sx20 clips2" style="line-height: 50rpx;">{{detailObj.title}}</view>
<view class="disjbac">
<view class="disac">
<!-- 发布者头像 -->
<image lazy-load class="flexs" :src="fabImg || appletImg"
style="width: 60rpx;height: 60rpx;border-radius: 100%;" mode="aspectFill"></image>
<view class="mar-z10">
<!-- 发布者昵称 -->
<view class="fon28 col3 clips1">{{detailObj.published_by || 'Company'}}</view>
<!-- 发布时间 -->
<view class="fon20 col9" style="margin-top: 6rpx;">{{detailObj.published_at}}发布
</view>
</view>
</view>
<view class="disac flexs">
<view class="disac fc" @tap="tapLike" style="width: 60rpx;">
<image v-if="isDetailLike" src="/static/public/detail-like.png"
style="width: 42rpx;height: 42rpx;" mode=""></image>
<image v-else src="/static/public/detail-nlike.png"
style="width: 42rpx;height: 42rpx;" mode=""></image>
<view class="fon24 col9 tc">{{likeCon}}</view>
</view>
<view class="disac fc mar-zy36 posir">
<image src="/static/public/weix.png" style="width: 42rpx;height: 42rpx;" mode=""></image>
<view class="fon24 col9">分享</view>
<button class="posia" open-type="share"
style="top: 0;right: 0;left: 0;bottom: 0;opacity: 0;">分享</button>
</view>
<view class="disac fc" @tap="tapConllection">
<image v-if="isDetailConllection" src="/static/public/yconllection.png"
style="width: 44rpx;height: 44rpx;" mode=""></image>
<image v-else src="/static/public/conllection.png"
style="width: 44rpx;height: 44rpx;" mode=""></image>
<view class="fon24 col9">收藏</view>
</view>
</view>
</view>
<!-- 内容详情 -->
<view class="fon28 mar-s20" style="color: #1A1A1A; line-height: 40rpx;">
<rich-text :nodes="detailInfo"></rich-text>
</view>
</view>
<view class="pad-zy20">
<view class="fon30 bold tc mar-sx40" :style="{color:publicColor}">相关推荐</view>
<!-- 相关推荐列表 -->
<list-pu @chooseLike="chooseLikex" @praise="praisexgEv" @comfirmev="comfirmevx" :list="xgList"></list-pu>
</view>
<view class="tc fon28 bold" style="color: #fff;background-color: #3875f6;padding: 20rpx;" @tap="gopage(cateCurrent)">{{contentVal}}>></view>
<view class="pad-zy20">
<view class="fon30 bold tc mar-sx40" :style="{color:publicColor}">推荐医生</view>
<!-- 推荐医生列表 -->
<list-doctor v-if="dataList.length!=0" :list="dataList"></list-doctor>
<view v-if="dataList.length==0" class="disjcac fc" style="margin-top: 10%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
</view>
</view>
</view>
<view v-if="cateCurrent!=isNum">
<view v-if="allList.length!=0" class="pad-zy20">
<list-pu @chooseLike="chooseLike" @praise="praiseEv" @comfirmev="comfirmev" :list="allList"></list-pu>
</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>
</view>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
<!-- 底部导航 -->
<view class="posixzy">
<bottom-tab></bottom-tab>
</view>
</view>
</view>
</template>
<script>
import listDoctor from '@/components/list-doctor.vue';
import swiperPu from '@/components/swiper-pu.vue';
import bottomTab from '@/components/bottom-tab.vue';
import {
collectionEV,
cancleCollectionEV
} from '@/jsFile/publicAPI.js';
export default {
components: {
listDoctor,
swiperPu,
bottomTab,
},
data() {
return {
statusBarHeight: uni.getSystemInfoSync().statusBarHeight,
isLoading: false,
cateCurrent: 0,
cateList: [],
bannerList: [], //
xgList: [ //
],
dataList: [ //
],
showTop: false,
isDetailLike: false, //
likeCon: '点赞',
isDetailConllection: false, //
isNum: 0,
listArrone: [], //
listArrtwo: [ //
],
listArrthree: [ //
],
listArrfour: [ //
],
detailObj: {}, //
detailInfo: '', //
category_id: '', //ID
active: '', //
share_id: 0,
invite_code: '',
isAutoPlay: false,
fabImg: '' ,//
allArr:[],
page:1,
size:20,
total:0,
isZanw:true,
allList:[],
contentVal:'',
newHeight:'450',
ifSwiper:0,//swiper
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() { //
if(this.cateCurrent!=this.isNum){
if(this.total!=this.allList.length){
this.page++
this.checkList(this.cateCurrent)//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
this.isZanw = false
}
}
},
onShareAppMessage(res) {
var ya = this;
this.$requst.post('user/record', {
type: 'content',
action: 'share',
id: this.detailObj.id
}).then(res => {
console.log('分享成功:', res);
}, error => {})
// tools.js
this.$toolAll.tools.plantPoint(4,this.detailObj.id);
console.log(`/pagesB/problemDetail/problemDetail?id=${this.detailObj.id}&category_id=${this.category_id}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`);
var shareObj = {
title: `${ya.detailObj.title}`, // (slogan)
path: `/pagesB/problemDetail/problemDetail?id=${this.detailObj.id}&category_id=${this.category_id}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
imageUrl: `${ya.$http}${ya.detailObj.share_img || ya.detailObj.cover}` //PNGJPG imageUrl 使 5:4
};
return shareObj;
},
onShow() {
this.isAutoPlay = true;
},
onHide() {
this.isAutoPlay = false;
},
onUnload() {
this.isAutoPlay = false;
},
onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
if (options.category_id != undefined) {
this.category_id = options.category_id
if(options.invite_code!=undefined){this.invite_code = options.invite_code;}
if (options.share_id != undefined){this.share_id = options.share_id;}
this.checkDetail(options.id);
// tools.js
this.$toolAll.tools.plantPoint(1,options.id);
}
}
},
methods: {
//
gopage(index){
uni.navigateTo({
url:`/pagesB/problemList/problemList?title=${this.cateList[index].title}&category_id=${this.cateList[index].id}`
})
},
chooseLike(e) { //
// console.log(this.dataList[e].is_collected);
if (this.allList[e].is_collected == 0) {
this.allList[e].is_collected = 1
//
collectionEV({
action: 'collect',
archive_id: this.allList[e].id
})
}
},
comfirmev(e) { //
this.allList[e].is_collected = 0;
this.$toolAll.tools.showToast('正在取消...', 'loading')
//
cancleCollectionEV({
action: 'collect',
archive_id: this.allList[e].id
})
},
chooseLikex(e) { //
if (this.xgList[e].is_collected == 0) {
this.xgList[e].is_collected = 1
//
collectionEV({
action: 'collect',
archive_id: this.xgList[e].id
})
}
},
comfirmevx(e) { //
this.xgList[e].is_collected = 0
this.$toolAll.tools.showToast('正在取消...', 'loading')
//
cancleCollectionEV({
action: 'collect',
archive_id: this.xgList[e].id
})
},
checkDetail(newId) {
this.$requst.post('archives/detail', {
id: newId,
share_id: this.share_id
}).then(res => {
// console.log('',res);
if (res.code == 0) {
this.isLoading = true
//
if (res.data.category.length != 0) {
res.data.category.forEach((item, index) => {
let cateObj = {
id: item.id, //ID
title: item.title, //
active: item.active, //
model_id: item.model_id, //ID
model_name: item.model_name, //
sort: item.sort
}
this.cateList.push(cateObj)
this.allArr.push([]);
//
if (item.active == 1) this.active = this.cateCurrent = index
//
if (this.category_id == item.id) this.isNum = index
})
this.contentVal = this.cateList[this.cateCurrent].title.slice(2);
if(this.cateList[this.cateCurrent].title== '毛发百科' || this.cateList[this.cateCurrent].title== '科普视频') {
this.newHeight = '200';
}
}
//
this.detailObj = res.data.detail;
// swiper
this.ifSwiper = this.detailObj.images_show;
if (this.detailObj.published_headimgurl != '') {
this.fabImg = this.$http + this.detailObj.published_headimgurl;
}
if (this.detailObj.is_liked == 1) {
if (this.detailObj.likes >= 1000) this.likeCon = '999+'
else this.likeCon = this.detailObj.likes
}
//
//
let arrImg = this.detailObj.images.split(',')
arrImg.forEach(item => {
let newImgObj = {
imgSrc: this.$http + item,
url: '',
isVideo: false,
poster: '',
}
//
this.bannerList.push(newImgObj)
})
//
if (this.detailObj.video != '') {
this.bannerList[0] = {
imgSrc: this.$http + arrImg[0],
url: this.$http + this.detailObj.video,
isVideo: true,
poster: '',
}
}
//
if (this.detailObj.is_collected == 0) this.isDetailConllection = false
if (this.detailObj.is_collected == 1) this.isDetailConllection = true
if (this.detailObj.is_liked == 0) this.isDetailLike = false
if (this.detailObj.is_liked == 1) this.isDetailLike = true
//
this.detailInfo = this.$toolAll.tools.escape2Html(this.detailObj.content)
// xgList
if(this.cateList[this.cateCurrent].title=='日记分享') {
if (res.data.diary.length != 0) {
res.data.diary.forEach(item => {
let fabImg = '';
if (item.published_headimgurl != '' && item.published_headimgurl != null) {
fabImg = this.$http + item.published_headimgurl
}
let tObj = {
category_id: item.category_id, //ID
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: fabImg || this.appletImg, //
name: item.published_by || 'Company', //
isVideo: item.video.includes(".mp4"), //
likes:item.likes,//
is_liked:item.is_liked//
}
if (item.cover != '' && item.video == '') {
this.xgList.push(tObj)
}
})
}
} else {
this.relevant();
}
//
if (res.data.doctor.length != 0) {
res.data.doctor.forEach(item => {
let doObj = {
id: item.id,
imgSrc: item.headimg != null ? item.headimg : '',
name: item.name,
cyear: parseFloat(item.work_time),
bmen: item.dept_name,
zcheng: '主任医师',
goodAt: item.diseases,
show_detail: item.show_detail
}
this.dataList.push(doObj)
})
}
this.choosecateEv(this.cateCurrent)
} else this.$toolAll.tools.showToast(res.msg);
}, error => {this.$toolAll.tools.showToast(error.msg);})
},
relevant(){
this.$requst.post('archives/category', {
category_id: this.cateList[this.cateCurrent].id,
keyword: '',
page:this.page,
size:this.size
}).then(res => {
if(res.code==0){
if (res.data.list.list.length != 0) {
res.data.list.list.forEach(item => {
let fabImg = '';
if (item.published_headimgurl != '' && item.published_headimgurl != null)
fabImg = this.$http + item.published_headimgurl
let tObj = {
category_id: item.category_id, //ID
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: fabImg || this.appletImg, //
name: item.published_by || 'Company', //
isVideo: item.video.includes(".mp4"), //
likes:item.likes,//
is_liked:item.is_liked//
}
if (item.cover != '' && item.video == '') {
this.xgList.push(tObj)
}
})
}
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},
choosecateEv(e) {
this.page = 1;
this.isZanw = true;
this.checkList(e);
},
checkList(e){
this.$requst.post('archives/category', {
category_id: this.cateList[e].id,
keyword: '',
page:this.page,
size:this.size
}).then(res => {
// console.log('',res);
if (res.code == 0) {
if(this.page==1) {
if(this.active != e) this.allList = [];
uni.pageScrollTo({
scrollTop:0,
duration:0
})
}
this.total = res.data.list.total;
if (res.data.list.list.length != 0) {
res.data.list.list.forEach(item => {
let num = item.video.search(".mp4")
let isVideo = false
if (num != '-1') isVideo = true
let fabImg = '';
if (item.published_headimgurl != '' && item.published_headimgurl != null)
fabImg = this.$http + item.published_headimgurl
let arrObj = {
category_id: item.category_id, //ID
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: fabImg || this.appletImg, //
name: item.published_by || 'Company', //
isVideo: isVideo ,//
likes:item.likes,//
is_liked:item.is_liked //
}
if (item.cover != '') {
this.allList.push(arrObj);
}
})
}
this.cateCurrent = e;
} else this.$toolAll.tools.showToast(res.msg);
}, error => {this.$toolAll.tools.showToast(error.msg);})
},
praiseEv(e){ //
if(this.allList[e].is_liked==0){
this.allList[e].is_liked = 1;
this.allList[e].likes++;
if(this.allList[e].likes>1000) this.allList[e].likes = '999+'
//
collectionEV({action:'like',archive_id:this.allList[e].id})
}
},
//
praisexgEv(e){
if(this.xgList[e].is_liked==0){
this.xgList[e].is_liked = 1;
this.xgList[e].likes++;
if(this.xgList[e].likes>1000) this.xgList[e].likes = '999+'
//
collectionEV({action:'like',archive_id:this.xgList[e].id})
}
},
tapLike() { //
this.isDetailLike = !this.isDetailLike
if (this.isDetailLike) {
this.detailObj.likes++
this.likeCon = this.detailObj.likes
if (this.likeCon >= 1000) this.likeCon = '999+'
} else {
this.detailObj.likes--
this.likeCon = '喜欢'
}
let isLikeCon = 'like'
//
if (this.isDetailLike) collectionEV({
action: isLikeCon,
archive_id: this.detailObj.id
})
//
else cancleCollectionEV({
action: isLikeCon,
archive_id: this.detailObj.id
})
},
tapConllection() { //
let isLikeCon = 'collect'
//
if (!this.isDetailConllection) collectionEV({
action: isLikeCon,
archive_id: this.detailObj.id
})
//
else cancleCollectionEV({
action: isLikeCon,
archive_id: this.detailObj.id
})
this.isDetailConllection = !this.isDetailConllection
},
backTop() { //
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
backEv(){
uni.navigateBack({delta:1})
}
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,197 @@
<template>
<view class="pad-x180">
<!-- 状态栏 -->
<status-nav :titleVal="titleStr" :statusTitle="true"></status-nav>
<!-- 输入框 -->
<view class="search-input-box bacf" :style="{paddingTop: statusHeight+'px'}">
<view class="disac pad-zy30 mar-s20">
<!-- 输入框 -->
<input @confirm="searchEv" @input="inputEv" class="width100 fon34 radius10 problem-input" 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 class="pad-zy20 mar-s20">
<!-- 列表 -->
<view v-if="dataList.length!=0">
<list-pu @chooseLike="chooseLike" @praise="praiseEv" @comfirmev="comfirmevl" :list="dataList"></list-pu>
</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>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
</view>
</template>
<script>
import cateTu from '@/components/cate-items/cate-tu.vue';
import {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js';
export default {
components:{
cateTu
},
data() {
return {
titleStr:'',//
searchVal:'',//
isShowT:false,//
cateList:[//
],
dataList:[//
],
showTop:false,//
newCurrent:0,
page:1,
size:10,
total:'',//
isZanw:true,
category_id:'',//ID
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
this.searchEv()//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
this.isZanw = false
}
},
onShareAppMessage() {
return {
title:this.titleStr,
path:`/pagesB/problemList/problemList?category_id=${this.category_id}&title=${this.titleStr}`
}
},
onLoad(options) {
this.category_id = options.category_id;//id
this.titleStr = options.title;//
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
this.searchEv()
}
},
methods: {
//
inputEv(e) {
this.page = 1;
},
chooseLike(e){//
if(this.dataList[e].is_collected==0){
this.dataList[e].is_collected = 1
//
collectionEV({action:'collect',archive_id:this.dataList[e].id})
}
},
praiseEv(e){ //
if(this.dataList[e].is_liked==0){
this.dataList[e].is_liked = 1;
this.dataList[e].likes++;
if(this.dataList[e].likes>1000) this.dataList[e].likes = '999+'
//
collectionEV({action:'like',archive_id:this.dataList[e].id})
}
},
comfirmevl(e){//
this.dataList[e].is_collected = 0
this.$toolAll.tools.showToast('正在取消...','loading')
//
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
},
searchEv(){//
this.$toolAll.tools.showToast('搜索中...')
this.$requst.post('archives/category',{page:this.page,size:this.size,category_id:this.category_id,keyword:this.searchVal}).then(res=>{
// console.log('',res);
if(res.code==0){
uni.hideToast()
if(uni.getStorageSync('cateList')==''){//
if(res.data.category.length!=0){
res.data.category.forEach((item,index)=>{
let cateObj = {
id:item.id,//ID
title:item.title,//
active:item.active,//
model_id:item.model_id,//ID
model_name:item.model_name,//
sort:item.sort
}
this.cateList.push(cateObj)
})
uni.setStorageSync('cateList',this.cateList)
}
} else {
//
this.cateList = uni.getStorageSync('cateList')
}
//
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 fabImg = '';
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
let tObj = {
category_id:item.category_id,//ID
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: fabImg || this.appletImg,//
name:item.published_by || 'Company',//
isVideo:item.video.includes(".mp4"),//
likes:item.likes,//
is_liked:item.is_liked//
}
this.dataList.push(tObj);
})
}
let obj = {
content:this.searchVal
}
}
})
},
cancleev(){//
this.isShowT = false
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,300 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'搜索'" :statusTitle="true"></status-nav>
<!-- 输入框 -->
<view class="search-input-box bacf" :style="{paddingTop: statusHeight+'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="请输入问题/病种/医生姓名"/>
<!-- 搜索 -->
<view @tap="searchEv" class="flexs mar-z30 radius10 pad-zy40 fon34 colf" style="height: 80rpx;line-height: 80rpx;" :style="{background:publicColor}">搜索</view>
</view>
<!-- 自定义二级分类 -->
<view class=" pad-zy20 mar-s40" v-if="!isList">
<cate-pu :newCurrent="newCurrent*1" :activeb="publicColor" :isCenter="false" :newbmo="'#E0E0E0'" @choosecateEv="chooseTwo" :newcateList="cateList"></cate-pu>
</view>
</view>
<!-- 历史搜索和热门搜索 -->
<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">
<list-pu @chooseLike="chooseLike" @praise="praiseEv" @comfirmev="comfirmevl" :list="dataList"></list-pu>
</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>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import cateTu from '@/components/cate-items/cate-tu.vue';
import {collectionEV,cancleCollectionEV} from '@/jsFile/publicAPI.js';
export default {
components:{
cateTu
},
data() {
return {
searchVal:'',//
reSearchList:[//
{
title:'历史搜索',
src:'/static/public/del-icon.png',
list:[]
},
{
title:'热门搜索',
src:'',
list:[
// {content:''},
// {content:''},
// {content:''},
// {content:''},
// {content:''},
]
},
],
isShowT:false,//
isList:true,//
cateList:[//
],
dataList:[//
],
showTop:false,//
newCurrent:0,
page:1,
size:10,
total:'',//
isZanw:true,
category_id:'',//ID
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
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
}
},
onUnload() {
uni.removeStorageSync('cateList')
},
onLoad(options) {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
if(options.keyWorld!=undefined && options.keyWorld!='') {
this.searchVal = options.keyWorld
this.searchEv()
}
this.checkSearchHistory()
this.checkKey()
}
},
onShow() {
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
if(this.searchVal!=undefined && this.searchVal!='') this.searchEv()
}
},
methods: {
checkKey(){//
this.$requst.get('index/hot-keywords').then(res=>{
// console.log('',res);
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let reObj = {
id:item.id,
content:item.keyword
}
this.reSearchList[1].list.push(reObj)
})
}
} else this.$toolAll.tools.showToast(res.msg);
},error=>{this.$toolAll.tools.showToast(error.msg);})
},
chooseLike(e){//
// console.log(this.dataList[e].is_collected);
if(this.dataList[e].is_collected==0){
this.dataList[e].is_collected = 1;
this.dataList[e].collects++;
//
collectionEV({action:'collect',archive_id:this.dataList[e].id})
}
},
praiseEv(e){ //
// console.log(this.dataList[e].is_collected);
if(this.dataList[e].is_liked==0){
this.dataList[e].is_liked = 1;
this.dataList[e].likes++;
if(this.dataList[e].likes>1000) this.dataList[e].likes = '999+'
//
collectionEV({action:'like',archive_id:this.dataList[e].id})
}
},
comfirmevl(e){//
this.dataList[e].is_collected = 0
this.$toolAll.tools.showToast('正在取消...','loading');
this.dataList[e].collects--;
//
cancleCollectionEV({action:'collect',archive_id:this.dataList[e].id})
},
checkSearchHistory(){//
this.$requst.post('user/search-history',{page:this.page,size:this.size}).then(res=>{
// console.log(res);
if(res.code==0){
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
if(item.keyword!=null){
let searchObj = {
id:item.id,
content:item.keyword
}
this.reSearchList[0].list.push(searchObj)
}
})
}
} else this.$toolAll.tools.showToast(ers.msg);
},error=>{this.$toolAll.tools.showToast(error.msg);})
},
searchEv(){//
// console.log('ID',this.category_id,'',this.searchVal);
this.$toolAll.tools.showToast('搜索中...')
//
this.$requst.post('archives/keyword-check',{keyword:this.searchVal}).then(res=>{
if(res.data.has) {
this.searchVal = '';
//
uni.navigateTo({
url:`/${res.data.target}`
})
} else {
//
this.$requst.post('archives/category',{page:this.page,size:this.size,category_id:this.category_id,keyword:this.searchVal}).then(res=>{
// console.log('',res);
if(res.code==0){
uni.hideToast()
if(uni.getStorageSync('cateList')==''){//
if(res.data.category.length!=0){
res.data.category.forEach((item,index)=>{
let cateObj = {
id:item.id,//ID
title:item.title,//
active:item.active,//
model_id:item.model_id,//ID
model_name:item.model_name,//
sort:item.sort
}
this.cateList.push(cateObj)
})
uni.setStorageSync('cateList',this.cateList)
}
} else {
//
this.cateList = uni.getStorageSync('cateList')
}
//
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 fabImg = '';
if(item.published_headimgurl!='' && item.published_headimgurl!=null) fabImg = this.$http + item.published_headimgurl;
let tObj = {
category_id:item.category_id,//ID
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: fabImg || this.appletImg,//
name:item.published_by || 'Company',//
isVideo:item.video.includes(".mp4"),//
likes:item.likes,//
is_liked:item.is_liked//
}
this.dataList.push(tObj);
// if(this.newCurrent==0 && item.category_id==32) this.dataList.push(tObj)
// if(this.newCurrent==1 && item.category_id==33) this.dataList.push(tObj)
// if(this.newCurrent==2 && item.category_id==34) this.dataList.push(tObj)
// if(this.newCurrent==3 && item.category_id==38) this.dataList.push(tObj)
})
}
let obj = {
content:this.searchVal
}
this.reSearchList[0].list.push(obj)
this.isList = false
}
})
}
})
},
delev(){//
this.isShowT = true
},
comfirmev(){//
this.isShowT = false
this.$requst.post('user/clear-search').then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('已清空')
this.reSearchList[0].list = []//
} else this.$toolAll.tools.showToast(res.msg);
},error=>{this.$toolAll.tools.showToast(error.msg);})
},
cancleev(){//
this.isShowT = false
},
chooseTwo(index){//
// console.log('',index);
this.isZanw = true
this.page = 1
this.newCurrent = index
this.category_id = this.cateList[index].id
this.searchEv()
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,133 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'分享中心'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy32">
<view class="radius20 pad20 bacf mar-s20 col3">
<view class="fon28 bold mar-x40 pad-z10">我的分享</view>
<view class="disja">
<view @tap="goPage(index)" class="disac fc flexs width33" v-for="(item,index) in dataList" :key="index">
<view class="fon36 bold clips1">{{item.num}}</view>
<view class="fon26 mar-s25">{{item.title}}</view>
</view>
</view>
</view>
<!-- 分享按钮 -->
<view @tap="shareEv" class="disjcac radius20 posir" style="height: 90rpx;margin: 70rpx 80rpx;background-color: #38CE51;line-height: 90rpx;">
<view class="disac">
<image src="/static/public/sharef.png" style="width: 54rpx;height: 54rpx;" mode=""></image>
<view class="fon40 bold colf mar-z10">分享给好友</view>
</view>
<!-- <button open-type="share" class="posia width100" style="opacity: 0;">分享给好友</button> -->
<!-- <button @tap="shareEv" class="posia width100" style="opacity: 0;">分享给好友</button> -->
</view>
</view>
<!-- 弹框 -->
<pu-po :isShowT="isShowT" :contentVal="'暂未开放此功能,请耐心等候'" :isCenter="true" :comfrimVal="'好的'" @comfirmev="isShowT=false"></pu-po>
<!-- 底部客服 -->
<!-- <public-customer :nbottom="100"></public-customer> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
<!-- 底部tab -->
<foot-tab :titleList="titleList" :imgList="imgList" :newcurrent='-1'></foot-tab>
</view>
</template>
<script>
export default {
data() {
return {
isShowT:false,
imgSrc:'/static/public/shareh.png',
dataList:[
{num:'0',title:'积分'},
{num:'0',title:'分享人'},
{num:'0',title:'分享订单'},
],
imgSrcP:uni.getStorageSync('imgSrcP'),
shareFlag:true
}
},
computed: {
//
titleList() {
return this.$store.state.titleList
},
//
imgList() {
return this.$store.state.imgList
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onShareAppMessage(options) {
var ya = this;
   var shareObj = {
    title: 'Company', // (slogan)
    path: `/pagesB/sharingCenter/sharingCenter?invite_code=${uni.getStorageSync('invite_code')}`, // /
    imageUrl: ya.imgSrc, //PNGJPG imageUrl 使 5:4
    success: function(res){
      //
      if(res.errMsg == 'shareAppMessage:ok'){
// tools.js
this.$toolAll.tools.plantPoint(4);
      }
    },
    fail: function(res){
      //
      if(res.errMsg == 'shareAppMessage:fail cancel'){
        //
      }else if(res.errMsg == 'shareAppMessage:fail'){
        // detail message
      }
    }
  };
  return shareObj;
},
onShow() {
this.$toolAll.tools.isLogin();
},
onLoad(options) {
uni.getStorageSync('shareAll')!='' ? this.dataList[1].num = uni.getStorageSync('shareAll').share_users.total : this.dataList[1].num = 0
},
methods: {
shareEv(){//
if(this.imgSrcP==''){
this.$toolAll.tools.showToast('请先前往个人海报申请海报')
} else {
this.$toolAll.tools.showToast('正在调起分享...','none',200000);
if(this.shareFlag){
this.shareFlag = false;
wx.showShareImageMenu({
path: this.imgSrcP,
success:(res=>{
uni.hideToast();
this.shareFlag = true;
this.$requst.post('user/record',{type:'other',action:'share',id:''}).then(res=>{console.log('分享成功:',res);},error=>{})
// tools.js
this.$toolAll.tools.plantPoint(4);
}),
fail:(err=>{
uni.hideToast();
this.shareFlag = true;
})
})
} else {this.$toolAll.tools.showToast('请勿重复点击');}
}
},
goPage(index){
let newUrl = ''
if(index==1) newUrl = '/pagesB/mysharer/mysharer'
uni.navigateTo({
url:newUrl
})
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,946 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav v-if="invite_code==''" :titleVal="'商品详情'" :statusTitle="true"></status-nav>
<view v-if="invite_code!=''" class="status-box statusHNH" style="background-color: #FFFFFF;">
<view :style="{height:statusBarHeight+'px'}"></view>
<view class="status-nav">
<!-- 标题 -->
<view class="tab-title tcenter" style="color: #000000;">商品详情</view>
</view>
</view>
<!-- 列表 -->
<view :style="{top: statusHeight+'px'}" v-if="isNei!=3" class="posiszy" style="height: 50px;">
<view class="bacf pad-zy32 pad-sx20">
<cate-pu @choosecateEv="choosecateEv" :activeb="invite_code!=''?'#3875F6':publicColor" :newCurrent="cateCurrent*1" :newbmo="'#F2F2F2'" :isCenter="false" :newcateList="cateList"></cate-pu>
</view>
</view>
<view :style="{top: statusHeight+'px'}" v-else class="posiszy" style="height: 50px;"></view>
<view class="pad-x180" :style="{paddingTop: isNei!=3?(statusHeight+60)+'px':statusHeight+'px'}">
<!-- 自定义轮播 -->
<view v-if="isLoading">
<swiper-pu v-if="cateCurrent==0" :isplay="isAutoPlay" :browseP="true" :bannerList="bannerList" :newHeight="swiperHeight" :newRadius="'0'" :newBottom="'5'"></swiper-pu>
<!-- <view v-if="isNei==3" class="score-box">{{detailObj.score}}</view> -->
<view v-show="cateCurrent==isNum">
<view class="pad20 bacf mar-zy20 radius20 mar-s20">
<!-- 标题 -->
<view class="mar-x20 fon36 col3 bold clips3 shop-title-box line-h50">
<view style="margin-top: -8rpx;margin-right: 10rpx;">
<span v-if="isNei!=3" class="radius15 colf fon20" :style="{background:publicColor}">{{detailObj.disease_name}}</span>
<span v-if="isNei==0" class="radius15 colf fon20 mar-z10"></span>
<span v-if="isNei==1" class="radius15 colf fon20 mar-z10"></span>
<span v-if="isNei==2" class="radius15 colf fon20 mar-z10"></span>
</view>
<span>{{detailObj.name}}</span>
</view>
<view class="fon24 col7D">{{detailObj.subtitle || '无任何额外消费'}}</view>
<!-- 团购商品详情时显示 -->
<view v-if="isNei==0" class="disjbac fon24 mar-s20 col7D">
<view>团购累计参与人员{{detailObj.activity_order_num}}</view>
<view>还剩余{{detailObj.group_surplus_num}}</view>
</view>
<!-- <view class="mar-s20 shop-price" v-if="isNei!=3"><span v-if="isNei==0">:</span><span v-if="isNei==1">:</span>{{detailObj.price/100}} <span v-if="isNei!=10">{{detailObj.original_price/100}}</span></view> -->
<view class="mar-s20 shop-price" v-if="isNei!=3"><span v-if="isNei==0">:</span><span v-if="isNei==1">:</span>{{detailObj.price/100}} <span>{{detailObj.original_price/100}}</span></view>
<view class="mar-s20 shop-price" v-else>{{detailObj.score}}</view>
<view class="disjbac shar-box" style="align-items: flex-end;">
<view>
<view class="disac" v-if="detailObj.level_text!=''">
<image class="flexs" src="/static/public/huiy.png" mode="aspectFill"></image>
<view class="fon24 col9">{{detailObj.level_text}}</view>
</view>
<view v-else class="fon24 col9">全部人员可买</view>
</view>
<view class="disac flexs">
<view class="disac fc mar-zy36 posir">
<image src="/static/public/weix.png" class="wh42" mode=""></image>
<view class="fon24 col9">分享</view>
<button class="posia-op" open-type="share">分享</button>
</view>
<view class="disac fc" @tap="tapConllection">
<image v-if="isDetailConllection" src="/static/public/yconllection.png" class="wh44" mode=""></image>
<image v-else src="/static/public/conllection.png" class="wh44" mode=""></image>
<view class="fon24 col9">收藏</view>
</view>
</view>
</view>
<view class="pad-x30 pad-s10 borbot" v-if="isNei==0 || isNei==1 ||isNei==2">
<view class="fon36 colf bold pbackc tc pad-sx20 radius45" v-if="daoTime!='活动已结束' && detailObj.is_close==0">{{daoTime}}</view>
<view class="fon36 colf bold pbackc tc pad-sx20 radius45" v-else>{{[daoTime,''][detailObj.is_close]}}</view>
</view>
<!-- 规格 -->
<view class="dis tc mar-s20 fon28">
<view class="col3 flexs" style="margin-top: 6rpx;">类型</view>
<view class="width100 disac fw" style="justify-content: flex-end;">
<view class="col6 mar-z30 mar-x20 molei" style="background: #F2F2F2;" v-for="(item,index) in skuCate" :key="index">{{item.title}}</view>
</view>
<!-- <view>
<view class="fon26 col3 mar-x20">上市时间</view>
<view class="fon24 colB3">{{detailObj.param_maket_time||'今年'}}</view>
</view>
<view>
<view class="fon26 col3 mar-x20">有效期</view>
<view class="fon24 colB3">{{detailObj.param_validity_time||'永久'}}</view>
</view>
<view>
<view class="fon26 col3 mar-x20">可用时间</view>
<view class="fon24 colB3">{{detailObj.param_use_time||'长期'}}</view>
</view>
<view>
<view class="fon26 col3 mar-x20">术前须知</view>
<view class="fon24 colB3">{{detailObj.param_notice||'无'}}</view>
</view> -->
</view>
</view>
<!-- 销量库存 -->
<view class="pad20 bacf mar-zy20 radius20 mar-s20">
<view class="fon28 disjbac">
<view class="col3">销量</view>
<view class="colB3">已售{{detailObj.amount}}</view>
</view>
<view class="fon28 disjbac mar-s40">
<view class="col3">库存</view>
<view class="colB3">剩余{{detailObj.stock}}</view>
</view>
</view>
<!-- 拼团 -->
<view v-if="isNei==1 && len!=0" class="pad20 bacf mar-zy20 radius20 mar-s20">
<view class="fon28 col3">{{len}}人正在拼团可以直接参与</view>
<swiper :autoplay="true" :interval="3000" :duration="1000" circular="true" class="shop-swiper" :style="{height: (len==1 && pingArr[0].length==1)?'110rpx':'280rpx'}" vertical="true">
<swiper-item v-if="pingArr[index].length!=0" v-for="(item,index) in pingArr" :key="index">
<view class="disjbac posir pad-x20" v-for="(itemt,indext) in item" :key="indext">
<image :src="itemt.imgSrc" mode="aspectFill" class="flexs big-img"></image>
<view class="disjbac width100 mar-z20 pad-sx20">
<view class="fon28 col3 width45">{{itemt.name}}</view>
<view class="fon28 disjbac width100 col7D">
<view class="flexs">
<view>还差{{itemt.num}}人拼成</view>
<view style="margin-top: 7rpx;">{{itemt.time_text}}</view>
</view>
<view @tap="comeTuan(itemt.id,index,indext)" class="colf bold flexs">去拼单</view>
</view>
</view>
<!-- 短线 -->
<view class="duan-xian"></view>
</view>
</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>
<view class="fon28 mar-s20" style="color: #1A1A1A; line-height: 40rpx;">
<rich-text :nodes="detailInfo"></rich-text>
</view>
</view>
<!-- 医生 -->
<view v-if="doctorList.length!=0" class="pad20 bacf mar-zy20 radius20 mar-s20">
<view class="fon28 col3 bold mar-x20">医生</view>
<!-- 推荐医生列表 -->
<list-doctor v-if="doctorList.length!=0" :list="doctorList"></list-doctor>
<view v-if="doctorList.length==0" class="disjcac fc" style="margin-top: 10%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<!-- <view class="fon24 col3">暂无推荐医生</view> -->
</view>
</view>
<!-- 产品推荐 -->
<view v-if="dataList.length!=0" class="fon30 bold mar-s40 mar-x10 pad-zy50 pcol"></view>
<shopList :dataList="dataList" v-if="dataList.length!=0"></shopList>
</view>
<view v-if="cateCurrent!=isNum">
<view v-if="allList.length!=0" class="pad-zy20">
<list-pu @chooseLike="chooseLike" @comfirmev="comfirmev" :list="allList"></list-pu>
</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>
</view>
<!-- 底部导航 -->
<view class="posixzy disjbac bacf pad-zy32 btnBKS">
<view class="posir">
<image @tap="backHome" class="posia backH" src="/static/public/back-home-02.png" mode="aspectFit"></image>
</view>
<view class="disac fon26 colf">
<view @tap="tuneUp(0)" class="disjcac lianShare addCart-btn"><span v-if="isNei!=1"></span><span v-else></span></view>
<view @tap="tuneUp(1)" class="disjcac lianShare mai-btn"><span v-if="isNei!=1"></span><span v-else></span></view>
</view>
</view>
<!-- 分享 -->
<view @tap="shareImgEv" class="detail-cart-box" style="display: flex;justify-content: center;align-items: center;width: 112rpx;height: 112rpx;border-radius: 100%;background-color: rgba(0,0,0,.5);bottom: 436rpx;color: #FFFFFF;">
分享
</view>
<!-- 购物车 -->
<view @tap="goShopCart" class="detail-cart-box">
<view class="posir">
<image src="/static/public/cart.png" mode="aspectFill"></image>
<view class="posia" v-if="cartNum!=0"><view>{{cartNum}}</view></view>
</view>
</view>
<!-- 客服 -->
<view @tap="lianK" class="shopKf">
<view class="posir">
<image src="/static/public/kf-logo.png" mode="aspectFill" style="width: 142rpx;height: 142rpx;"></image>
<button open-type="contact" class="posia-op"></button>
</view>
</view>
<!-- 立即购买加入购物车弹框 -->
<view v-if="showTK" class="posAll" style="z-index: 1000;" @tap="showTK=false">
<view class="bacf posixzy bottom-popu" @tap.stop="showTK=true">
<view class="disjb pad-zy50">
<image :src="zhuImg" mode="aspectFill"></image>
<view class="disjbac width100">
<view v-if="isNei!=3">
<view class="fon40 mar-sx10 colf8">{{skuDetail.price/100}}</view>
<!-- <view v-if="isNei!=10"><span class="yuan-price">{{skuDetail.original_price/100}}</span></view> -->
<view><span class="yuan-price">{{skuDetail.original_price/100}}</span></view>
</view>
<view v-else><view class="fon40 mar-sx10 colf8">积分{{skuDetail.score}}</view></view>
<image @tap.stop="showTK=false" src="/static/public/cha-close.png" style="margin-right: 0rpx;" mode=""></image>
</view>
</view>
<!-- 标题 -->
<view class="fon36 col3 bold clips3 pad-zy30 mar-s20 shop-title-box line-h50">
<view style="margin-top: -8rpx;margin-right: 10rpx;">
<span class="radius15 colf fon20" :style="{background:publicColor}">{{detailObj.disease_name}}</span>
<span class="radius15 colf fon20 mar-z10" v-if="isNei==0"></span>
<span class="radius15 colf fon20 mar-z10" v-if="isNei==1"></span>
<span class="radius15 colf fon20 mar-z10" v-if="isNei==2"></span>
</view>
<span>{{detailObj.name}}</span>
</view>
<view class="dis mar-sx40 pad-zy30 col3">
<view class="fon28 flexs" style="margin-top: 6rpx;">类型</view>
<view class="fon26 disac fw width100" style="justify-content: flex-end;">
<view @tap="chooselei(indexl)" class="mar-x20" v-for="(item,indexl) in allRes.sku" :key="indexl" :class="leiIndex==indexl?'activelei':'molei'" :style="{background:leiIndex==indexl?publicColor:'#F2F2F2'}">{{item.title}}</view>
</view>
</view>
<view class="disjbac mar-sx40 pad-zy30 fon28">
<view class="col3">库存</view>
<view class="fon26 col3" style="color: #5B5B5B;">{{skuDetail.stock}}</view>
</view>
<view class="disjbac mar-sx40 pad-zy30 fon28">
<view class="col3">购买数量</view>
<view class="fon26 col3 disac bold">
<image @tap="buyNum!=1?buyNum--:''" src="/static/public/del.png" class="del-btn" mode=""></image>
<input type="text" @input="inputNum" v-model="buyNum" class="num-input"/>
<image @tap="buyNum++" src="/static/public/add.png" class="add-btn" mode=""></image>
</view>
</view>
<!-- 加入购物车立即购买 -->
<view v-if="isNei!=1" class="disjbac pad-zy30 colf fon32 mar-x50">
<view @tap="addCart" class="ev-btn pbackc">加入购物车</view>
<view v-if="isNei!=3" @tap.stop="goGetReadyDan(0)" class="ev-btn bcf8"></view>
<view v-else @tap.stop="goGetReadyDan(0)" class="ev-btn bcf8">立即兑换</view>
</view>
<!-- 单独购买立即拼团 -->
<view v-else class="disjbac pad-zy30 colf fon32 mar-x50">
<view @tap.stop="goGetReadyDan(2)" class="ev-btn" :style="{backgroundColor: ifAlone ? '#F85050' : '#C8C8C8'}">单独购买</view>
<view @tap.stop="goGetReadyDan(0)" class="ev-btn bcf8" :style="{backgroundColor: ifAlone ? '#C8C8C8' : ''}">发起拼团</view>
</view>
</view>
</view>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</view>
</template>
<script>
import listDoctor from '@/components/list-doctor.vue';
import swiperPu from '@/components/swiper-pu.vue';
import {cancleCollectionShopEV,collectionShopEV} from '@/jsFile/publicAPI.js';
import shopList from '@/components/shop-list.vue';
import { base64ToPath } from '@/jsFile/base64-src.js';
export default {
components:{
listDoctor,
swiperPu,
shopList
},
data() {
return {
statusBarHeight:uni.getSystemInfoSync().statusBarHeight,
isLoading:false,
cateCurrent:0,
swiperHeight:uni.getSystemInfoSync().windowWidth,
cateList:[{
id:1,
title:'商品详情',
pid:11,
sort:4
}],
bannerList:[],//
//
xgList:[],
//
dataList:[],
showTop:false,
isDetailConllection:false,//
isNum:0,
listArrone:[],//
//
listArrtwo:[],
//
listArrthree:[],
//
listArrfour:[],
//
doctorList:[],
detailObj:{},//
detailInfo:'',//
category_id:'',//ID
active:'',//
share_id:0,
invite_code:'',
showTK:false,
leiIndex:0,
showPD:false,
isNei:'',//
pingArr:[],//
len:0,//
pinInfo:{},//
allRes:{},//
zhuImg:'',//cover
skuDetail:{},//sku
buyNum:1,//
daoTime:'',//
csNum:0,//,
isBuy:0,//
ispt:0,//01 2
isScore:0,//
cartNum:0,
skuCate:[],//
pinDao:'',//
serverTime:'',//
timerServer:null,
timerp:null,
timera:null,
pinUserId:0,//ID
isAutoPlay:false,
page:1,
size:20,
total:0,
isZanw:true,
allList:[],
isactivity:0,//01
orderId:'',//id
timeout:null,
shareId:'',
shareFlag:true,
ifAlone:false
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
},
appletImg() {
return this.$store.state.appletImg
}
},
onReachBottom() { //
if(this.cateCurrent!=this.isNum){
if(this.total!=this.allList.length){
this.page++
this.checkList(this.cateCurrent)//
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多列表','none',1000)
this.isZanw = false
}
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onShareAppMessage(res) {
let shareImgSrc = '';
var ya = this;
this.$requst.post('user/record',{type:this.detailObj.is_activity==0 ? 'spu':'activity',action:'share',id:this.detailObj.id}).then(res=>{console.log('分享成功:',res);},error=>{})
// tools.js
this.$toolAll.tools.plantPoint(this.detailObj.is_activity==0 ? 10 : 11,this.detailObj.is_activity==0 ? this.detailObj.id*1 : this.detailObj.activity_id);
if(ya.detailObj.share_img==null) ya.detailObj.share_img = ya.detailObj.cover;
var shareObj = {
     title: `${ya.detailObj.subtitle || ya.detailObj.name}`, // (slogan)
     path: `/pagesB/shopDetail/shopDetail?id=${this.detailObj.is_activity==1?this.detailObj.activity_id:this.detailObj.id}&category_id=${this.category_id}&is_activity=${this.detailObj.is_activity==0 ? 0 : 1}&share_id=${uni.getStorageSync('userId')}&invite_code=${uni.getStorageSync('invite_code')}`, // /
     imageUrl: `${ya.$http}${ya.detailObj.share_img || ya.detailObj.cover}`//PNGJPG imageUrl 使 5:4
  };
  return shareObj;
},
onShow() {
uni.removeStorageSync('chooseAddress');
uni.removeStorageSync('payType');
this.isAutoPlay = true;
},
onHide() {
this.isAutoPlay = false;
},
onUnload() {
clearInterval(this.timera);
clearInterval(this.timerp);
clearInterval(this.timerServer);
this.isAutoPlay = false;
},
onLoad(options) {
this.isactivity = options.is_activity;
this.orderId = options.id;
if(options.category_id!=undefined) {
this.category_id = options.category_id
this.invite_code = options.invite_code
}
if(options.share_id!=undefined) this.share_id = options.share_id
if(options.isIntegral=="true"){this.isScore = 3;}
if(uni.getStorageSync('phone_active')!=0 && uni.getStorageSync('is_active')!=0){
//
this.cartNumEv();
//
this.checkDetail(options.id,options.is_activity);
//
if(options.shareCate==1) {
// options.checkGrounpIid
// options.share_id:id
this.sharePin(options.checkGrounpId,options.share_id);
}
}
},
methods: {
//
shareImgEv(){
this.$toolAll.tools.showToast('分享图生成中...','none',10000);
if(this.shareFlag){
this.shareFlag = false;
this.$requst.post('spu/share',{id:this.orderId,is_activity:this.isactivity}).then(res=>{
base64ToPath(res.data.share_img).then(path=>{
uni.hideToast();
this.$toolAll.tools.showToast('正在调起分享...');
wx.showShareImageMenu({
path: path,
success:(res=>{
this.shareFlag = true;
this.$requst.post('user/record',{type:'content',action:'share',id:this.orderId}).then(res=>{console.log('分享成功:',res);},error=>{})
// tools.js
this.$toolAll.tools.plantPoint(4);
}),
fail:(err=>{
this.shareFlag = true;
})
})
})
})
} else {this.$toolAll.tools.showToast('请勿重复点击');}
},
//
tuneUp(index){
if(this.isNei!=1) {
} else {
if(index==1) {
this.ifAlone = false;
} else {
this.ifAlone = true;
}
}
if(this.detailObj.is_close==0){
this.showTK = true;
} else {
this.$toolAll.tools.showToast('该商品活动已结束')
}
},
//
inputNum(e){
clearTimeout(this.timeout);
let str = e.detail.value;
this.timeout = setTimeout(()=>{
if(str=='' || str==0){
this.buyNum = 1;
}
},500)
},
sharePin(id,u_id){
// id:id
this.$requst.post('spu/group-list',{id:id}).then(res=>{
if(res.code==0){
if(res.data.length){
res.data.forEach(item=>{
console.log(item.id,u_id);
if(item.id==u_id){
this.pinInfo = {
id:item.id,
imgSrc:item.cover,
name:item.name,
num:item.num
}
this.showPD = true;
this.detailPTime(item.time);
}
})
}
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
},
cartNumEv(){//
let ntype = 'spu'
if(this.isScore==3) ntype = 'score';
this.$requst.post('order/shopping-cart-count',{type:ntype}).then(res=>{
if(res.code==0){
this.cartNum = res.data.count;
}
})
},
checkPTList(id){//
uni.request({
url:`${getApp().globalData.hostApi}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,
name:item.name,
num:item.num,//
time:item.time,//
time_text:item.time_text//
}
this.pingArr.push(pObj);
})
this.len = this.pingArr.length;
let n = 2; //2
let lineNum = this.len % 2 === 0 ? this.len / 2 : Math.floor( (this.len / 2) + 2 );
let newPArr = [];
for (let i = 0; i < lineNum; i++) {
let temp = this.pingArr.slice(i*n, i*n+n);
newPArr.push(JSON.parse(JSON.stringify(temp)));
}
this.pingArr = newPArr;
}
} else this.$toolAll.tools.showToast(res.msg);
},
fail:(err)=> {
this.$toolAll.tools.showToast(err.msg);
}
})
},
goGetReadyDan(index){//
this.showTK = false;
// {id:1,imgSrc:'/static/tabbar/mya.png',title:'99线',price:3888,num:1,isActive:false},
let nprice = '';
if(this.isNei==3) {
nprice = this.skuDetail.score;
} else nprice = this.skuDetail.price/100;
this.ispt = index;
if(index==2){nprice = this.skuDetail.original_price/100;}
let params = {
id:this.detailObj.activity_id || this.detailObj.spu_id,
imgSrc:this.$http + this.detailObj.cover,
coding:this.skuDetail.coding,
price:nprice,
num:this.buyNum || 1,
title:this.detailObj.name,
sku_name:this.skuDetail.title,
is_score:this.detailObj.is_score,
group_id:this.ispt,//0 1 2
is_only:this.ispt,
pin_user_id:this.pinUserId,//ID
category_id:this.category_id,//ID
cateNum:this.isNei,
checkGrounpId:this.detailObj.id,//ID
is_activity:this.detailObj.is_activity
}
let newList = [params];
uni.setStorageSync('orderList',newList);
if(this.isNei!=3) {
//
uni.setStorageSync('payType',this.detailObj.pay_type);
} else {uni.setStorageSync('payType','')}
uni.navigateTo({
// url:`/pagesA/getReadyDan/getReadyDan?isNei=${this.isNei}&isVirtual=${this.detailObj.spu_type}`
url:`/pagesA/getReadyDan/getReadyDan-two?isNei=${this.isNei}&isVirtual=${this.detailObj.spu_type}`
})
},
addCart(){//
if(this.csNum==0){
this.csNum++;
this.$toolAll.tools.showToast('正在加入购物车...');
this.$requst.post('order/shopping-cart-add',{sku_id:this.skuDetail.id,num:this.buyNum}).then(res=>{
if(res.code==0) {
this.showTK = false;
this.$toolAll.tools.showToast('添加购物车成功(*^▽^*)');
this.cartNumEv();
this.csNum = 0;
} else this.$toolAll.tools.showToast(res.msg);
}).catch(err=>{this.$toolAll.tools.showToast(err.msg);})
}
},
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)
},
detailPTime(endtime){
this.pinDao = this.$toolAll.tools.dayTime(endtime,new Date());
this.timerp = setInterval(()=>{
if((new Date(endtime).getTime()) - (new Date().getTime())<=0){
this.pinDao = '已结束';
this.checkPTList(this.detailObj.id);
this.showPD = false;
clearInterval(this.timerp);
} else {
this.pinDao = this.$toolAll.tools.dayTime(endtime,new Date());
}
},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;
this.skuDetail = this.allRes.sku[index];
},
lianK(){//
this.$requst.post('user/rand-bind-service').then(res=>{})
this.$toolAll.tools.closeTimer()//
this.$requst.post('user/record',{type:'other',action:'ask',id:0}).then(res=>{},error=>{})
// tools.js 1314
this.$toolAll.tools.plantPoint(this.detailObj.is_activity==0 ? 13:14);
},
chooseLike(e) { //
// console.log(this.dataList[e].is_collected);
if (this.allList[e].is_collected == 0) {
this.allList[e].is_collected = 1;
this.dataList[e].collects++;
//
collectionEV({
action: 'collect',
archive_id: this.allList[e].id
})
}
},
comfirmev(e) { //
this.allList[e].is_collected = 0;
this.$toolAll.tools.showToast('正在取消...', 'loading');
this.dataList[e].collects--;
//
cancleCollectionEV({
action: 'collect',
archive_id: this.allList[e].id
})
},
backHome(){
uni.navigateTo({
url:'/pages/tabbar/pagehome/pagehome'
})
},
checkDetail(newId,is_activity){
uni.request({
url:`${getApp().globalData.hostApi}spu/detail`,
data:{id:newId,is_activity:is_activity},
method:'post',
header:{
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: (res) => {
console.log(res,'结果');
if(res.data.code==0){
this.allRes = res.data.data;
this.zhuImg = this.$http + res.data.data.detail.cover;
// sku
if(res.data.data.sku.length!=0){
res.data.data.sku.forEach(item=>{
if(item.is_default==1) {
this.skuDetail = item;
}
})
}
this.isLoading = true;
//
if(res.data.data.category.length!=0){
res.data.data.category.forEach((item,index)=>{
let cateObj = {
id:item.id,//ID
title:item.title,//
active:item.active,//
model_id:item.model_id,//ID
model_name:item.model_name,//
sort:item.sort
}
this.cateList.push(cateObj)
//
if(item.active==1) this.active = this.cateCurrent = index
//
// if(this.category_id==item.id) this.isNum = index
})
}
//
this.detailObj = res.data.data.detail;
//
this.skuCate = res.data.data.sku;
if(this.detailObj.activity_type=='group_buy') this.isNei = 0;
if(this.detailObj.activity_type=='group_make') this.isNei = 1;
if(this.detailObj.activity_type=='limit_time') this.isNei = 2;
if(this.detailObj.activity_type=='normal') {
if(this.isScore==3) {
this.isNei = this.isScore;
} else this.isNei = 10;
}
if(res.data.data.detail.activity_end_at!=undefined){
let startTime = new Date(res.header.Date).getTime();
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);//
this.timera = setInterval(()=>{//
startTime = startTime + 1000;
this.daoTime = this.$toolAll.tools.dayTime(res.data.data.detail.activity_end_at,startTime);
},1000)
}
}
// tools.js 访89
this.$toolAll.tools.plantPoint(this.detailObj.is_activity==0 ? 8 : 9,this.detailObj.is_activity==0 ? this.detailObj.id*1 : this.detailObj.activity_id);
//
//
let arrImg = this.detailObj.images.split(',')
arrImg.forEach(item=>{
let newImgObj = {
imgSrc:this.$http + item,
url:'',
isVideo:false,
poster:'',
}
//
this.bannerList.push(newImgObj)
})
//
if(this.detailObj.video!=''){
this.bannerList[0] = {
imgSrc:this.$http + arrImg[0],
url:this.$http + this.detailObj.video,
isVideo:true,
poster:'',
}
}
//
if(this.detailObj.is_collected==0) this.isDetailConllection = false
if(this.detailObj.is_collected==1) this.isDetailConllection = true
//
this.detailInfo = this.$toolAll.tools.escape2Html(this.detailObj.content)
//
if(res.data.data.doctor.length!=0){
res.data.data.doctor.forEach(item=>{
let docObj = {
id: item.id,
imgSrc: item.headimg != null ? item.headimg : '',
name: item.name,
cyear: parseFloat(item.work_time),
bmen: item.dept_name,
zcheng: '主任医师',
goodAt: item.diseases,
show_detail: item.show_detail
}
this.doctorList.push(docObj);
})
}
//
if(this.isNei==1 && this.detailObj.activity_going.length!=0) {
this.checkPTList(this.detailObj.id);//
}
this.checkShopList();
}
}
})
},
checkShopList(){//
let params = {
keyword:'',//
page:1,
size:10,
doctor_role:'',// doctor= design=
doctor_name:'',//
activity:'',// + normal=group_make=group_buy=;limit_time=
disease_id:''//ID
}
uni.request({
url:`${getApp().globalData.hostApi}spu/list`,
data:params,
method:'post',
header:{
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
success: (res) => {
if(res.data.code==0){
this.dataList = [];
if(res.data.data.list.length!=0){
res.data.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)
group_cover.push(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
reponseTime:res.header.Date,//
activity_end_at:item.activity_end_at,//
activity_group_cover:group_cover,//
activity_group_num:item.activity_group_num,//
activity_id:item.activity_id
}
this.dataList.push(obj)
})
}
}
}
})
},
goShopCart(){//
let isScore = '';
if(this.isNei==3) isScore = 'score';
uni.navigateTo({
url:`/pagesA/shopCart/shopCart?isScore=${isScore}`
})
},
goDoctor(id){
uni.navigateTo({
url:`/pagesB/doctorDetail/doctorDetail?doctor_id=${id}`
})
},
choosecateEv(e){//
this.$requst.post('archives/category', {
category_id: this.cateList[e].id,
keyword: '',
page:this.page,
size:this.size
}).then(res => {
// console.log('',res);
if (res.code == 0) {
if(this.page==1) {
if(this.active != e) this.allList = [];
uni.pageScrollTo({
scrollTop:0,
duration:0
})
}
this.total = res.data.list.total;
if (res.data.list.list.length != 0) {
res.data.list.list.forEach(item => {
let num = item.video.search(".mp4")
let isVideo = false
if (num != '-1') isVideo = true
let fabImg = '';
if (item.published_headimgurl != '' && item.published_headimgurl != null)
fabImg = this.$http + item.published_headimgurl
let arrObj = {
category_id: item.category_id, //ID
id: item.id,
is_liked:item.is_liked,
likes:item.likes,
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: fabImg || this.appletImg, //
name: item.published_by || 'Company', //
isVideo: isVideo //
}
if (item.cover != '') {
this.allList.push(arrObj);
}
})
}
this.cateCurrent = e;
} else this.$toolAll.tools.showToast(res.msg);
}, error => {this.$toolAll.tools.showToast(error.msg);})
},
tapConllection(){//
let isLikeCon = 'collect';
let nid = '';
if(this.detailObj.is_activity==1) nid=this.detailObj.spu_id;
else nid=this.detailObj.id;
//
if(!this.isDetailConllection) collectionShopEV({action:isLikeCon,id:nid})
//
else cancleCollectionShopEV({action:isLikeCon,id:nid})
this.isDetailConllection = !this.isDetailConllection
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,412 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'商品搜索'" :statusTitle="true"></status-nav>
<!-- 输入框 -->
<view class="search-input-box bacf poszy shop-nav-box" :style="{top: statusHeight+'px'}">
<view class="disac pad-zy30 mar-s20">
<!-- 输入框 -->
<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="checkShopList" class="flexs mar-z30 radius10 pad-zy40 fon34 colf" style="height: 80rpx;line-height: 80rpx;" :style="{background:publicColor}">搜索</view>
</view>
<!-- 筛选结果 -->
<view v-if="search_result" class="pad-z20 pad-x20">
<view class="col3 fon28 mar-s30">搜索结果</view>
</view>
</view>
<!-- 数据列表 -->
<view v-if="search_result" :style="{marginTop:statusHeight+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:statusHeight+titleHeight+10+'px'}">
<cate-tu :list="reSearchList" @delev='delev'></cate-tu>
</view>
<!-- 购物车 -->
<navigator url="/pagesA/shopCart/shopCart?isScore=false" hover-class="none">
<view class="cart-box">
<view class="posir">
<image src="/static/public/cart.png" mode="aspectFill"></image>
<view class="posia" v-if="cartNum!=0"><view>{{cartNum}}</view></view>
</view>
</view>
</navigator>
<!-- 弹框 -->
<pu-po :isShowT="isShowT" @comfirmev="comfirmev" @cancleev="cancleev"></pu-po>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
import {cartNum} from '@/jsFile/publicAPI.js';
import cateTu from '@/components/cate-items/cate-tu.vue';
export default {
components:{
cateTu
},
data() {
return {
searchVal:'',//
reSearchList:[//
{
title:'历史搜索',
src:'/static/public/del-icon.png',
list:[]
},
{
title:'热门搜索',
src:'',
list:[
// {content:''},
// {content:''},
// {content:''},
// {content:''},
// {content:''},
]
},
],
isShowT:false,//
showTop:false,//
newCurrent:0,
page:1,
size:200,
total:'',//
isZanw:true,
activeIndex:'-1',
shopCate:['全部病种','全部医生','全部活动'],
cateTitle:'',
bingzList:[],//
zanBingArr:[],//
titleHeight:'',//
shaiList:[],//
dataList:[],
searchVal:'',//
doctor_role:'',// doctor= design=
doctor_name:'',//
activity:'',// + normal=group_make=group_buy=;limit_time=
disease_id:'',//ID
cartNum:0,
search_result:false,
timeList:[],
zanArr:[],
timer:'',
isShowP:false,
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//
// 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.checkShopList();
} else {
this.search_result = false;
}
if(uni.getStorageSync('token')!=''){
//
this.checkSearchHistory();
//
this.checkKey();
}
// +
const query = wx.createSelectorQuery()
query.select('.search-input-box').boundingClientRect((rect) => {
// console.log('+',rect.height);
this.titleHeight = rect.height
}).exec()
},
onShow() {
if(uni.getStorageSync('token')!=''){
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=>{
if(res.code==0){
this.cartNum = res.data.count;
}
})
},
//
checkShopList(){
this.isZanw = true;
let params = {
keyword:this.searchVal,//
page:this.page,
size:this.size,
}
uni.request({
url:`${getApp().globalData.hostApi}spu/list`,
data:params,
method:'post',
header:{
'Content-Type': 'application/json; charset=UTF-8',
'Authorization': 'Bearer '+uni.getStorageSync('token') || ''
},
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;
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)
group_cover.push(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,//
reponseTime:res.header.Date,//
activity_end_at:item.activity_end_at,//
activity_group_cover:group_cover,//
activity_group_num:item.activity_group_num,//
}
this.zanArr.push(obj)
})
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;
}
}
},
fail(err) {
this.$toolAll.tools.showToast(err.msg);
}
})
},
goPage(id,index){//
uni.navigateTo({
url:`/pagesB/shopDetail/shopDetail?id=${id}&isIntegral=${this.dataList[index].isIntegral}`
})
},
checkKey(){//
this.$requst.get('index/hot-keywords',{type:'spu'}).then(res=>{
// console.log('',res);
if(res.code==0){
if(res.data.length!=0){
res.data.forEach(item=>{
let reObj = {
id:item.id,
content:item.keyword
}
this.reSearchList[1].list.push(reObj)
})
}
} else this.$toolAll.tools.showToast(res.msg);
},error=>{this.$toolAll.tools.showToast(error.msg);})
},
checkSearchHistory(){//
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){
res.data.list.forEach(item=>{
if(item.keyword!=null){
let searchObj = {
id:item.id,
content:item.keyword
}
this.reSearchList[0].list.push(searchObj)
}
})
}
} else this.$toolAll.tools.showToast(res.msg);
},error=>{this.$toolAll.tools.showToast(error.msg);})
},
delev(){//
this.isShowT = true
},
comfirmev(){//
this.isShowT = false
this.$requst.post('user/clear-search').then(res=>{
if(res.code==0){
this.$toolAll.tools.showToast('已清空')
this.reSearchList[0].list = []//
} else this.$toolAll.tools.showToast(res.msg);
},error=>{this.$toolAll.tools.showToast(error.msg);})
},
cancleev(){//
this.isShowT = false
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,140 @@
<template>
<view>
<!-- 状态栏 -->
<status-nav :titleVal="'用户足迹'" :statusTitle="true"></status-nav>
<!-- 自定义二级分类 -->
<!-- 列表 -->
<view :style="{paddingTop: statusHeight+'px'}" class="pad-zy30">
<view class="radius20 fon28 col3 mar-sx20">
<view class="disac">
<view class="disjbac width100 radius10 pad-zy20 xialak bacf">
<input class="fon28 width100" type="text" @confirm="searchEv" v-model="keyword" placeholder="请输入姓名/电话查找" placeholder-style="color: #B3B3B3;" />
</view>
<view @tap="searchEv" class="flexs tc mar-z30 colf radius10 customer-btn" :style="{background:publicColor}">搜索</view>
</view>
</view>
<!-- 列表 -->
<view @tap="chooseId(item.id)" v-if="item.name!=null" class="bacf radius10 pad20 mar-x20 fon28" v-for="(item,index) in dataList" :key="index">
<view style="color: #B3B3B3;" class="disjbac">{{item.time}} <view style="color: #000000;">{{item.mobile}}</view></view>
<view class="mar-s20">
<text class="bold col3">{{item.name}}</text>
<text style="color: #B3B3B3;">{{item.action}}</text>
<text class="bold col3" v-if="item.title!=null && item.title!=''">{{item.title}}</text>
<text style="color: #B3B3B3;" v-if="item.zwhat!=null && item.zwhat!=''">{{item.zwhat}}</text>
</view>
</view>
<view v-if="dataList.length==0 && keyword!=''" class="disjcac fc" style="margin-top: 50%;">
<image class="zanw-img" src="/static/public/nothing.png" mode="aspectFill"></image>
<view class="fon24 col3">您搜索的内容暂无结果换个关键词试试吧</view>
</view>
<!-- 返回顶部 -->
<!-- <back-top :showTop="showTop" @backTop="backTop"></back-top> -->
</view>
<!-- 底部客服 -->
<public-customer :nbottom="100"></public-customer>
<!-- 用户信息授权手机号授权 -->
<auth-userInfo-mobileInfo></auth-userInfo-mobileInfo>
</view>
</template>
<script>
export default {
data() {
return {
dataList:[],//
showTop:false,//
customer_id:'',//ID
keyword:'',//
page:1,
size:10,
total:'',//
isZanw:true,
}
},
computed: {
//
publicColor() {
return this.$store.state.publicColor
},
statusHeight() {
return this.$store.state.statusHeight
}
},
onPageScroll(e) {
e.scrollTop > 360 ? this.showTop = true : this.showTop = false
},
onReachBottom() {//
if(this.total!=this.dataList.length){
this.page++
this.checkList()
} else {
if(this.isZanw) this.$toolAll.tools.showToast('暂无更多足迹内容')
this.isZanw = false
}
},
onShow() {
this.$toolAll.tools.isLogin()
},
onLoad(options) {
if(uni.getStorageSync('token')!='') {
this.checkList();
}
},
methods: {
chooseId(id){
this.backTop()
this.page = 1
this.isZanw = true
this.customer_id = id
this.keyword = ''
this.checkList()
},
searchEv(){//
if(this.keyword!='') this.customer_id = ''
this.page = 1
this.isZanw = true
this.checkList()
},
checkList(){//
let params = {
page:this.page,
size:this.size,
customer_id:this.customer_id,//ID
keyword:this.keyword,
// user_id:uni.getStorageSync('userId')
}
this.$requst.post('user/footmarks',params).then(res=>{
// console.log('',res);
if(this.page==1) this.dataList = []
this.total = res.data.total
if(res.data.list.length!=0){
res.data.list.forEach(item=>{
let newCate = ''
if(item.content_id > 0) newCate = item.category
else newCate = ''
let obj = {
id:item.account_id,
name:item.nickname,
action:item.action,
title:item.title,
time:item.created_at,
zwhat:newCate,
mobile:item.mobile
}
this.dataList.push(obj)
})
}
})
},
backTop(){//
uni.pageScrollTo({
scrollTop: 0,
duration: 300
});
},
}
}
</script>
<style>
</style>

View File

@ -0,0 +1,70 @@
<template>
<div style="width:100%;overflow-x:hidden;">
<image class="" @tap="backEv" :style="{top:statusHeight/2+'px'}" src="/static/public/videoBack.png" style="width: 33rpx;height: 33rpx;position: fixed;z-index: 10;left: 20rpx;" mode="aspectFill"></image>
<video id="myVideo" style="width: 100%;" :style="{height:newHeight+'px'}" autoplay="true"
:src="videoSrc" :enable-play-gesture="dans" :poster="posterSrc"
:controls="isControls" :show-center-play-btn="isCenterImg" :show-play-btn="isBottomImg" :show-fullscreen-btn="isFull"
@play="comePlay" @pause="comePause"></video>
<!-- 封面图 -->
<image v-if="isPlayImg" @tap="playEv" src="/static/public/video.png" style="position: fixed;top: 50%;left: 50%;
width: 126rpx;height: 126rpx;transform: translate(-50%, -50%);" mode="aspectFill"></image>
</div>
</template>
<script>
export default {
data(){
return {
newHeight:uni.getSystemInfoSync().windowHeight,
videoSrc:'',
isPlayImg:false,
autoplay:true,
videoContext:'',
title:'',//视频的标题,全屏时在顶部展示
posterSrc:'',//视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效
isControls: false,//是否显示默认播放控件(播放/暂停按钮、播放进度、时间)
dans:true,//是否开启播放手势,即双击切换播放/暂停
isCenterImg:false,//是否显示视频中间的播放按钮
isBottomImg:true,//是否显示视频底部控制栏的播放按钮
isFull:true//是否显示全屏按钮
}
},
computed:{
statusHeight() {
return this.$store.state.statusHeight
}
},
onReady: function (res) {
this.videoContext = uni.createVideoContext('myVideo', this)
},
onLoad(options) {
// 禁用小程序分享
this.$toolAll.tools.disableShareEv();
this.videoSrc = options.src
this.posterSrc = options.posterSrc
},
methods:{
backEv(){
uni.navigateBack({
delta:1
})
},
playEv(){
this.isPlayImg = false;
this.autoplay = false;
this.videoContext.play();
},
comePlay(){//当开始/继续播放时触发play事件
this.isControls = true;
},
comePause(){
this.isPlayImg = true;
this.isControls = false;
}
}
}
</script>
<style>
</style>

9
sitemap.json Normal file
View File

@ -0,0 +1,9 @@
{
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html// sitemap 的索引提示是默认开启的,如需要关闭 sitemap 的索引提示,可在小程序项目配置文件 project.config.json 的 setting 中配置字段 checkSiteMap 为 false",
"rules": [
{
"action": "allow",
"page": "*"
}
]
}

BIN
static/public/aboutus.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
static/public/add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 225 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

BIN
static/public/address60.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

BIN
static/public/back-home.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 783 B

BIN
static/public/backTop.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Some files were not shown because too many files have changed in this diff Show More