更新小程序仓库
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
import{recommendPrice} from "../../api/consult.js"
|
||||
const app = getApp()
|
||||
import {throttle} from "../../utils/util"
|
||||
Component({
|
||||
behaviors: [],
|
||||
externalClasses: ['consultbox'],
|
||||
// 属性定义(详情参见下文)
|
||||
properties: {
|
||||
myProperty: { // 属性名
|
||||
type: String,
|
||||
value: ''
|
||||
}
|
||||
},
|
||||
|
||||
data: {
|
||||
price:null,
|
||||
img_host:'https://oss.prod.applets.igandanyiyuan.com/applet/patient/static'
|
||||
}, // 私有数据,可用于模板渲染
|
||||
|
||||
lifetimes: {
|
||||
// 生命周期函数,可以为函数,或一个在 methods 段中定义的方法名
|
||||
attached: function () { },
|
||||
moved: function () { },
|
||||
detached: function () { },
|
||||
},
|
||||
|
||||
// 生命周期函数,可以为函数,或一个在 methods 段中定义的方法名
|
||||
attached: function () { }, // 此处 attached 的声明会被 lifetimes 字段中的声明覆盖
|
||||
ready: function() { },
|
||||
|
||||
pageLifetimes: {
|
||||
// 组件所在页面的生命周期函数
|
||||
show() {
|
||||
this.getPrice();
|
||||
this.setData({
|
||||
img_host:app.hostConfig().imghost
|
||||
})
|
||||
},
|
||||
hide: function () { },
|
||||
resize: function () { },
|
||||
},
|
||||
|
||||
methods: {
|
||||
goFree:throttle(function(){
|
||||
app.method.navigateTo({
|
||||
url: '/pages/expertConsult/expertConsult?type=free',
|
||||
})
|
||||
}),
|
||||
goQuick:throttle(function(){
|
||||
app.method.navigateTo({
|
||||
url: '/pages/quickConsult/quickConsult'
|
||||
})
|
||||
}),
|
||||
goExpert:throttle(function(){
|
||||
app.method.navigateTo({
|
||||
url: '/pages/expertConsult/expertConsult'
|
||||
})
|
||||
}),
|
||||
goBuyMedince:throttle(function(){
|
||||
app.method.navigateTo({
|
||||
url: '/pages/quickConsult/quickConsult?inquiry_type=4'
|
||||
})
|
||||
}),
|
||||
getPrice(){
|
||||
recommendPrice().then(data=>{
|
||||
this.setData({
|
||||
price:data
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<!--components/consultList/consultList.wxml-->
|
||||
<view class="consultbox">
|
||||
<view class="viewwrap">
|
||||
<view class="leftimg">
|
||||
<image src="{{img_host+'/freezx.png'}}" class="zxicon"></image>
|
||||
<view class="right">
|
||||
<view class="name">公益咨询</view>
|
||||
<view class="price">¥{{price.welfare_inquiry_price}}<text class="unit">起</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="consultbtn">
|
||||
<view class="btn" bindtap="goFree">去咨询</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="viewwrap">
|
||||
<view class="leftimg">
|
||||
<image src="https://img.applets.igandanyiyuan.com/applet/patient/static/quickzx.png" class="zxicon"></image>
|
||||
<view class="right">
|
||||
<view class="name" >快速问诊</view>
|
||||
<view class="price">¥{{price.quick_inquiry_price}}<text class="unit"></text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="consultbtn">
|
||||
<view class="btn" bindtap="goQuick">去咨询</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="viewwrap">
|
||||
<view class="leftimg">
|
||||
<image src="https://img.applets.igandanyiyuan.com/applet/patient/static/expertzx.png" class="zxicon"></image>
|
||||
<view class="right">
|
||||
<view class="name">专家问诊</view>
|
||||
<view class="price">¥{{price.expert_inquiry_price}}<text class="unit">起</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="consultbtn">
|
||||
<view class="btn" bindtap="goExpert">去咨询</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="viewwrap">
|
||||
<view class="leftimg">
|
||||
<image src="https://img.applets.igandanyiyuan.com/applet/patient/static/buyyao.png" class="zxicon"></image>
|
||||
<view class="right">
|
||||
<view class="name" >问诊购药</view>
|
||||
<view class="price">¥{{price.medicine_inquiry_price}}<text class="unit"></text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="consultbtn">
|
||||
<view class="btn" bindtap="goBuyMedince">去咨询</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -0,0 +1,67 @@
|
||||
/* components/consultList/consultList.wxss */
|
||||
.consultbox{
|
||||
margin:0 32rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.consultbtn .btn{
|
||||
width: 160rpx;
|
||||
height: 60rpx;
|
||||
background: #3CC7C0;
|
||||
color:#fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
font-size: 30rpx;
|
||||
border-radius: 30rpx;
|
||||
}
|
||||
.viewwrap{
|
||||
border-bottom:1rpx solid #E7E7E7;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding:30rpx 0rpx 30rpx;
|
||||
margin:0 52rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.viewwrap:last-child{
|
||||
border-bottom:none;
|
||||
}
|
||||
.viewwrap .right{
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
.viewwrap .price{
|
||||
margin-top: 10rpx;
|
||||
font-weight: 600;
|
||||
font-size: 34rpx;
|
||||
color: #EF4F20;
|
||||
}
|
||||
.viewwrap .name{
|
||||
font-size: 28rpx;
|
||||
font-weight: 600;
|
||||
color: #333333
|
||||
}
|
||||
.top{
|
||||
width:100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
padding:20rpx 0;
|
||||
}
|
||||
.top .up{
|
||||
width:40rpx;
|
||||
height:22rpx;
|
||||
}
|
||||
.leftimg{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
}
|
||||
.price .unit{
|
||||
color:#333;
|
||||
font-weight: normal;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
.zxicon{
|
||||
width:80rpx;
|
||||
height:80rpx;
|
||||
}
|
||||
Reference in New Issue
Block a user