This commit is contained in:
唐明明
2022-12-27 17:45:28 +08:00
5 changed files with 251 additions and 75 deletions

View File

@@ -6,6 +6,12 @@
import { request } from '../index' import { request } from '../index'
// 服务包首页app/services
const index = () =>{
return request({
url: "app/services"
})
}
// 金法分类 // 金法分类
const categories = () =>{ const categories = () =>{
return request({ return request({
@@ -27,6 +33,19 @@ const zf = (data) =>{
}) })
} }
// 自由服务包详情
const recharge = () =>{
return request({
url: "app/services/recharge"
})
}
// // 自由服务包支付
const zyPay = (id) =>{
return request({
url: "app/services/recharge/"+id+"/pay",
method:'post'
})
}
// 服务包详情 // 服务包详情
const fwbDetail = (service) =>{ const fwbDetail = (service) =>{
@@ -40,5 +59,8 @@ export {
jf, jf,
zf, zf,
fwbDetail, fwbDetail,
index,
recharge,
zyPay,
} }

0
new_file.json Normal file
View File

View File

@@ -6,8 +6,33 @@
"navigationBarTitleText": "抖火法务咨询服务", "navigationBarTitleText": "抖火法务咨询服务",
"navigationBarBackgroundColor": "#FFFFFF" "navigationBarBackgroundColor": "#FFFFFF"
} }
}, }, {
{ "path": "pages/index/introduces",
"name": "Introduces",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "金法服务包介绍",
"app-plus": {
"titleNView": {
"backgroundColor": "#FFFFFF",
"type": "transparent"
}
}
}
}, {
"path": "pages/index/free",
"name": "FreeService",
"style": {
"navigationStyle": "custom",
"navigationBarTitleText": "自由服务包介绍",
"app-plus": {
"titleNView": {
"backgroundColor": "#FFFFFF",
"type": "transparent"
}
}
}
}, {
"path": "pages/index/introduces", "path": "pages/index/introduces",
"name": "Introduces", "name": "Introduces",
"style": { "style": {
@@ -75,7 +100,6 @@
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
} }
}, { }, {
"path": "pages/richText/richText", "path": "pages/richText/richText",
"name": "RichText", "name": "RichText",
@@ -298,16 +322,16 @@
"navigationBarTitleText": "机构信息", "navigationBarTitleText": "机构信息",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#446EFE", "navigationBarBackgroundColor": "#446EFE",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"app-plus": { "app-plus": {
"titleNView": { "titleNView": {
"buttons": [{ "buttons": [{
"text": "使用历史", "text": "使用历史",
"color": "#ffffff", "color": "#ffffff",
"fontSize": "28rpx", "fontSize": "28rpx",
"width": "180rpx" "width": "180rpx"
}] }]
} }
} }
} }
}, { }, {
@@ -318,16 +342,16 @@
"navigationBarTitleText": "基础信息", "navigationBarTitleText": "基础信息",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#446EFE", "navigationBarBackgroundColor": "#446EFE",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"app-plus": { "app-plus": {
"titleNView": { "titleNView": {
"buttons": [{ "buttons": [{
"text": "使用历史", "text": "使用历史",
"color": "#ffffff", "color": "#ffffff",
"fontSize": "28rpx", "fontSize": "28rpx",
"width": "180rpx" "width": "180rpx"
}] }]
} }
} }
} }
}, { }, {
@@ -417,30 +441,30 @@
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
} }
}, { }, {
"path": "pages/user/userdata", "path": "pages/user/userdata",
"auth": true, "auth": true,
"name": "UserData", "name": "UserData",
"style": { "style": {
"navigationBarTitleText": "账户信息", "navigationBarTitleText": "账户信息",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
} }
}, { }, {
"path": "pages/user/userdataBase", "path": "pages/user/userdataBase",
"auth": true, "auth": true,
"name": "UserDataBase", "name": "UserDataBase",
"style": { "style": {
"navigationBarTitleText": "账户信息 - 基础信息", "navigationBarTitleText": "账户信息 - 基础信息",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
} }
},{ }, {
"path": "pages/user/userdataBanks", "path": "pages/user/userdataBanks",
"auth": true, "auth": true,
"name": "UserDataBank", "name": "UserDataBank",
"style": { "style": {
"navigationBarTitleText": "账户信息 - 机构信息", "navigationBarTitleText": "账户信息 - 机构信息",
"enablePullDownRefresh": false, "enablePullDownRefresh": false,
"navigationBarBackgroundColor": "#ffffff" "navigationBarBackgroundColor": "#ffffff"
} }
} }

95
pages/index/free.vue Normal file
View File

@@ -0,0 +1,95 @@
<template>
<view class="introduce" v-if='loaded'>
<image class="richTxt" :src="base.cover" mode="widthFix" />
<view class="nowbuy" @click="nowBuy" v-if="!is_recharge"> <view class="btn">{{base.price}} 立即购买 </view> </view>
<view class="nowbuy nonebuy" v-else> <view class="btn"> 已开通 </view> </view>
</view>
</template>
<script>
import {
recharge,zyPay
} from '@/apis/interfaces/index.js'
export default {
data() {
return {
loaded:false,
base: '',
is_recharge: true,
}
},
onLoad(e) {
this.getInfo()
},
methods:{
getInfo(){
recharge().then(res => {
this.base = res.base
this.is_recharge = res.is_recharge
this.loaded = true
}).catch(err => {
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
duration: 2000
})
})
},
nowBuy(){
zyPay(this.base.service_id).then(res => {
uni.showToast({
title: '支付成功',
icon: 'none',
mask: true,
duration: 2000
})
this.is_recharge = true
}).catch(err => {
console.log(err)
uni.showToast({
title: err.message,
icon: 'none',
mask: true,
duration: 2000
})
})
}
}
}
</script>
<style lang="scss" scoped>
.introduce{
padding-bottom: 120rpx;
.nowbuy{
position: fixed;
bottom: 0;
height: 120rpx;
padding-bottom: 20rpx;
text-align: center;
width: 100%;
color: #fff;
font-size: 32rpx;
font-weight: bold;
background-color: #fff;
.btn{
height: 90rpx;
line-height: 90rpx;
margin: 20rpx $margin*2 0 $margin*2;
border-radius: 80rpx;
background: linear-gradient( to right, #e5584c,#ee7b46);
}
}
.nonebuy{
color: #333;
font-weight: none;
.btn{
background: linear-gradient( to right, #ececec,#ececec);
}
}
.richTxt{
width: 100%;
}
}
</style>

View File

@@ -7,12 +7,14 @@
class="banner-swiper" class="banner-swiper"
:list="bannerArr" :list="bannerArr"
:indicator="true" :indicator="true"
keyName="cover"
previousMargin="20" previousMargin="20"
nextMargin="20" nextMargin="20"
circular circular
radius="10" radius="10"
bgColor="#ffffff" bgColor="#ffffff"
height="100%" height="100%"
@click='swiperClick'
/> />
</view> </view>
<view class="notice"> <view class="notice">
@@ -22,7 +24,9 @@
<u-notice-bar <u-notice-bar
icon="" icon=""
:text="notice" :text="notice"
fontSize="13" url=''
linkType='navigateTo'
fontSize="14"
direction="column" direction="column"
bgColor="#fff" bgColor="#fff"
color="#111111" color="#111111"
@@ -31,9 +35,8 @@
</view> </view>
</view> </view>
<!-- 自由服务包 --> <!-- 自由服务包 -->
<view class="free"> <view class="free" @click="clickFree">
<image class="free-img" src="@/static/index/index_banner_free.png" mode="widthFix" /> <image class="free-img" src="@/static/index/index_banner_free.png" mode="widthFix" />
<!-- <image class="free-img" src="@/static/imgs/index-img.png" mode="widthFix"></image> -->
</view> </view>
<!-- 金法产品 --> <!-- 金法产品 -->
<view class="block"> <view class="block">
@@ -61,7 +64,7 @@
> >
<image class="cover" :src="item.cover" mode="aspectFill" /> <image class="cover" :src="item.cover" mode="aspectFill" />
<view class="title nowrap">{{item.title}}</view> <view class="title nowrap">{{item.title}}</view>
<view class="price nowrap"><text></text>{{item.price}}</view> <view class="price nowrap"><text></text>{{item.price}}<text class="ding" v-if="item.type">定金</text></view>
</view> </view>
</scroll-view> </scroll-view>
</view> </view>
@@ -69,11 +72,10 @@
<view class="block"> <view class="block">
<view class="block-title"> <view class="block-title">
<view class="title">综法产品</view> <view class="title">综法产品</view>
<view class="more">更多<u-icon class="more-icon" size="28rpx" color="#999" name="arrow-right" /></view>
<!-- <view class="more">更多<u-icon class="more-icon" size="28rpx" color="#999" name="arrow-right"></u-icon></view> -->
</view> </view>
<view class="zong-list"> <view class="zong-list">
<view class="zong-list-item" v-for="(item, index) in zfList" :key="index"> <view class="zong-list-item" v-for="(item, index) in 3" :key="index">
<image class="cover" src="@/static/imgs/index-pack-01.png" mode="aspectFill" /> <image class="cover" src="@/static/imgs/index-pack-01.png" mode="aspectFill" />
<view class="colum-flex"> <view class="colum-flex">
<view class="title nowrap">2022年尊享综法服务包</view> <view class="title nowrap">2022年尊享综法服务包</view>
@@ -87,7 +89,7 @@
<script> <script>
import { region } from '@/apis/interfaces/address.js' import { region } from '@/apis/interfaces/address.js'
import { categories,jf,zf } from '@/apis/interfaces/index.js' import { categories,jf,zf,index } from '@/apis/interfaces/index.js'
export default { export default {
data() { data() {
return { return {
@@ -98,38 +100,21 @@
theTabStyle : { theTabStyle : {
left: '0%' left: '0%'
}, },
bannerArr : [ bannerArr : [],
'https://cdn.uviewui.com/uview/swiper/swiper1.png', notice : [],
'https://cdn.uviewui.com/uview/swiper/swiper2.png',
'https://cdn.uviewui.com/uview/swiper/swiper3.png',
],
notice : [
'王**信用卡法务咨询办理成功(今日)',
'王**信用卡法务咨询办理成功(今日)',
'王**信用卡法务咨询办理成功(今日)',
'王**信用卡法务咨询办理成功(今日)',
'王**信用卡法务咨询办理成功(今日)',
],
jfList:[], jfList:[],
defaultViewId:'', defaultViewId:'',
zfList:[], zfList:[],
} }
}, },
onLoad() { onLoad() {
categories().then(res=>{ this.getCategory()
this.theTabs = this.theTabs.concat(res)
}).catch(err=>{
uni.showToast({
title:err.message,
icon:'none',
mask:true,
duration:2000
})
})
this.getJf() this.getJf()
this.getIndex()
this.getZf() this.getZf()
}, },
methods: { methods: {
// 获取金法列表
getJf(){ getJf(){
let params = { let params = {
category_id:this.theTabId category_id:this.theTabId
@@ -156,6 +141,7 @@
url:'/pages/index/introduces?id='+id url:'/pages/index/introduces?id='+id
}) })
}, },
// 获取综法列表
getZf(){ getZf(){
zf().then(res=>{ zf().then(res=>{
// this.jfList = res // this.jfList = res
@@ -167,11 +153,65 @@
duration:2000 duration:2000
}) })
}) })
},// 获取综法列表
// 首页轮播图及公告
getIndex(){
index().then(res=>{
this.bannerArr = res.bannners
let list = []
res.notices.map(item=>{
let params = item.user.name + ' ' + item.user.text
list.push(params)
})
this.notice = list
}).catch(err=>{
uni.showToast({
title:err.message,
icon:'none',
mask:true,
duration:2000
})
})
},
// 获取金法分类列表
getCategory(){
categories().then(res=>{
this.theTabs = this.theTabs.concat(res)
}).catch(err=>{
uni.showToast({
title:err.message,
icon:'none',
mask:true,
duration:2000
})
})
},
// 金法产品筛选
onTheTab(e){
if(e.category_id != this.theTabId){
let index = this.theTabs.findIndex(val => val.category_id === e.category_id)
this.theTabStyle = {
left: index * 25 + '%'
}
this.theTabId = e.category_id
this.getJf()
}
}, },
// 选择城市节点 // 选择城市节点
onCityPicker(e){ onCityPicker(e){
this.getRegion(e.value); this.getRegion(e.value);
}, },
// 点击轮播图
swiperClick(e){
// console.log(this.bannerArr[e])
},
// 点击轮播图跳转自由服务包
clickFree(){
console.log('clickFree.....')
uni.navigateTo({
url:'/pages/index/free'
})
},
// 获取城市数据 // 获取城市数据
getRegion(id){ getRegion(id){
region({ region({
@@ -180,17 +220,6 @@
console.log(res) console.log(res)
}) })
}, },
// 金法产品筛选
onTheTab(e){
if(e.category_id != this.theTabId){
let index = this.theTabs.findIndex(val => val.category_id === e.category_id)
this.theTabStyle = {
left: index * 25 + '%'
}
this.theTabId = e.category_id
this.getJf()
}
}
} }
} }
</script> </script>
@@ -220,7 +249,7 @@
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
.notice-title{ .notice-title{
background-color: #ECF0FF; background-color: #ececec;
color: #000; color: #000;
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
@@ -358,6 +387,12 @@
text{ text{
font-size: 80%; font-size: 80%;
} }
.ding{
font-size: 64%;
margin-left: 4rpx;
position: relative;
bottom: 2rpx;
}
} }
} }
} }