待支付订单支付

This commit is contained in:
2021-11-30 16:54:05 +08:00
parent 00677377ca
commit bb9f67d3f8
26 changed files with 879 additions and 598 deletions
+3 -3
View File
@@ -99,7 +99,7 @@ const getRandMoney = () => service.get(`/api/order/get-rand-money`)
const postCount = (course_id, data) => service.put(`/api/course/count/${course_id}`, data);
// 功德箱
const getMeritBox = (temple_id, type, page, size = 10) => service.get(`/api/temple/get-merit-box?temple_id=${temple_id}&type=${type}&page=${page}&size=${size}`,)
const getMeritBox = (temple_id = '', type, page, size = 10) => service.get(`/api/temple/get-merit-box?temple_id=${temple_id}&type=${type}&page=${page}&size=${size}`,)
// 添加功德箱订单
const createMeritBoxOrder = data => service.post(`/api/order/create-merit-box`, data)
@@ -108,10 +108,10 @@ const createMeritBoxOrder = data => service.post(`/api/order/create-merit-box`,
const getDynamicData = (page = 1, goods_id = '', size = 10) => service.get(`/api/dynamic/get-page?page=${page}&size=${size}&goods_id=${goods_id}`);
// 获取动态(佛事)详情
const getDynamicDetail = (dynamic_id) => service.get(`/api/dynamic/detail?id=${dynamic_id}`);
const getDynamicDetail = (dynamic_id = '') => service.get(`/api/dynamic/detail?id=${dynamic_id}`);
// 通用商品列表(功德无量)
const getCommonGoods = (temple_id, page, size = 10) => service.get(`/api/common/get-list?temple_id=${temple_id}&page=${page}&size=${size}`);
const getCommonGoods = (temple_id = '', page, size = 10) => service.get(`/api/common/get-list?temple_id=${temple_id}&page=${page}&size=${size}`);
// 获取订单榜
const getOrderCompare = (temple_id = '1', type = '', goods_id = '', goods_type = '') => service.get(`/api/order/get-compare?temple_id=${temple_id}&type=${type}&goods_id=${goods_id}&goods_type=${goods_type}`);
-1
View File
@@ -45,7 +45,6 @@ display: -webkit-box;
.merit-group {
display: flex;
flex-wrap: nowrap;
margin-bottom: .91rem;
margin: 0 .4rem;
}
}
+3 -3
View File
@@ -1,5 +1,5 @@
<template>
<div class="process" v-if="privateData" @click="onProcessDetail">
<div class="buddha-process" v-if="privateData" @click="onProcessDetail">
<span class="date">{{ privateData.time || privateData.date }}</span>
<div class="process-detail">
<h1 class="title">{{ privateData.title }}</h1>
@@ -83,7 +83,7 @@ export default {
</script>
<style lang="scss">
.process {
.buddha-process {
display: flex;
position: relative;
padding: 0 0.4rem;
@@ -99,7 +99,7 @@ export default {
bottom: 0;
left: 0;
}
& ~ .process {
& ~ .buddha-process {
padding-top: 0.53rem;
}
.date {
+1
View File
@@ -25,6 +25,7 @@ export default {
right: 0;
border-top: .01rem solid #ddd;
background: white;
z-index: 100;
}
</style>
+19 -3
View File
@@ -4,8 +4,8 @@
<div class="add-merit-name" >
<h3 class="title">心愿</h3>
<div class="desire-input">
<textarea class="desire-textarea" v-model="desire" type="text" maxlength="50" placeholder="请输入您的心愿" />
<span>{{desire.length}}/50</span>
<textarea class="desire-textarea" v-model="desire" type="text" :max-length="maxLength" placeholder="请输入您的心愿" />
<span>{{desire.length}}/{{maxLength}}</span>
</div>
<div class="desire-quike">
<div class="bar">
@@ -13,7 +13,7 @@
<span class="update" @click="getDreamList">换一组<i class="iconfont icon-shuaxin"></i></span>
</div>
<div class="name-group">
<span class="name" v-for="(dream, index) in dreamList" :key="index" @click="desire = dream">{{dream}}</span>
<span class="name" v-for="(dream, index) in dreamList" :key="index" @click="onFill(dream)">{{dream}}</span>
</div>
</div>
<button class="confirm" @click="onConfirmDream">确认</button>
@@ -31,11 +31,19 @@ export default {
type: Boolean,
default: false
},
mode: {
type: String,
default: 'increment', // increment | single
},
selected: {
type: Array,
default(){
return []
}
},
maxLength: {
type: Number,
default: 50
}
},
data() {
@@ -56,6 +64,13 @@ export default {
this.getDreamList();
},
methods: {
onFill(dream){
if(this.mode === 'single'){
return this.desire = dream;
}
this.desire += dream + ',';
this.desire = this.desire.slice(0, this.maxLength)
},
onClose() {
this.$emit('update:visible', false);
},
@@ -159,6 +174,7 @@ export default {
padding: .25rem;
height: 2rem;
resize: none;
line-height: 1.4;
}
span {
+3 -3
View File
@@ -1,11 +1,11 @@
<template>
<div class="merit-goods">
<div class="merit-goods" @click="onJoin">
<img class="goods" :src="data.cover_url" alt="">
<div class="info">
<h3 class="title">{{data.title}}</h3>
<div class="bar">
<span class="join-number">已有{{data.sales}}人参与</span>
<button class="join" @click="onJoin">参与</button>
<button class="join" >参与</button>
</div>
</div>
</div>
@@ -21,7 +21,7 @@ export default {
name: 'goods-detail',
query: {
goods_id: this.data.id,
temple_id: this.$route.query.temple_id
temple_id: this.data.temple_id
}
})
}
+16 -2
View File
@@ -1,7 +1,7 @@
<template>
<div class="order">
<div class="order" @click="handleOrder">
<div class="order-head">
<span class="temple-name" @click="onTemple">{{data.temple_name}}<i class="iconfont icon-arrow-right"></i></span>
<span class="temple-name" @click.stop="onTemple">{{data.temple_name}}<i class="iconfont icon-arrow-right"></i></span>
<span class="status">{{data.status}}</span>
</div>
<div class="order-body">
@@ -25,6 +25,20 @@ export default {
methods: {
onTemple(){
this.$router.push({ name: 'temple-home', query: { temple_id: this.data.temple_id} })
},
handleOrder(){
if(this.data.status === '待支付'){
this.$router.push({
name: 'pay',
query: {
order_id: this.data.id,
title: this.data.goods_name,
subTitle: this.data.spec_name,
quantity: this.data.buy_total,
amount: this.data.order_amount
}
})
}
}
}
}
+1 -1
View File
@@ -1,5 +1,5 @@
<template>
<van-uploader class="custom-uploader" v-bind="$attrs" v-model="fileList" :after-read="onBeforeUpload"></van-uploader>
<van-uploader class="custom-uploader" v-bind="$attrs" :max-count="maxCount" v-model="fileList" :after-read="onBeforeUpload"></van-uploader>
<!-- <van-uploader class="custom-uploader" v-bind="$attrs" :max-size="isOverSize" :max-count="maxCount" v-model="fileList" @oversize="onOversize" :after-read="onBeforeUpload"></van-uploader> -->
</template>
+6 -3
View File
@@ -1,5 +1,5 @@
import Vue from 'vue'
import VueAwesomeSwiper from 'vue-awesome-swiper';
import MescrollVue from 'mescroll.js/mescroll.vue';
import globalMixin from './mixins';
import App from './App.vue'
import delay from 'delay'
@@ -7,14 +7,17 @@ import router from './router';
import '@/assets/js/flexable.js';
import './common/vant';
import './components/index'
import 'swiper/css/swiper.css'
// swiper 样式全局引入, 组件页面引入。 Ref: https://www.jianshu.com/p/03f9fa94c474
import 'swiper/css/swiper.css';
import config from './config';
import utils from './util'
Vue.mixin(globalMixin)
Vue.config.productionTip = false
Vue.prototype.$delay = delay;
Vue.prototype.$config = config;
Vue.use(VueAwesomeSwiper)
Vue.prototype.$utils = utils;
Vue.component('mescroll-vue', MescrollVue)
new Vue({
render: h => h(App),
+42 -15
View File
@@ -105,14 +105,14 @@
<ul class="spec brick-spec">
<li class="random">
<span class="border-circle" :class="[is_assign && 'active']" @click="onCustomeBrike">{{data.rule_btn}}</span>
<van-stepper v-model="buy_quantity" step="1" />
<van-stepper v-model="buy_quantity" step="1" v-if="is_assign" />
</li>
<li v-for="(spec, index) in data.spec" :key="index">
<span
class="border-circle"
:class="[Number(spec.money) === priceUnit && !is_assign && 'active']"
@click="onPriceUnit(spec)"
>认捐{{spec.donate_number}}块砖 {{spec.money}}元</span>
>{{spec.spec_name}} {{spec.donate_number * Number(data.price)}}元</span>
</li>
</ul>
<div class="auto-donate">
@@ -126,7 +126,7 @@
<div class="donate">
<span class="label">行善时间</span>
<span class="time-cycle">
<van-stepper v-model="number" step="1" />
<van-stepper v-model="monthQuantity" step="1" />
<span class="unit">个月</span>
</span>
</div>
@@ -134,7 +134,7 @@
<div class="next-group-wrapper">
<safe-area>
<div class='next-group'>
<span class="total">合计:¥{{priceTotal}}</span>
<span class="total">合计:<em>¥{{priceTotal}}</em></span>
<button class="next" @click="onToPay">下一步</button>
</div>
</safe-area>
@@ -179,7 +179,7 @@ export default {
showSpec: false,
priceUnit: 0,
priceUnitId: '',
number: 1,
monthQuantity: 1,
is_assign: false, // 是否为自动认捐砖块数
buy_quantity: 1, // 自定义认捐砖块数
goodsDynamicList: [], // 商品动态列表
@@ -195,14 +195,17 @@ export default {
},
computed: {
priceTotal(){
if(this.is_auto){
return (parseInt(this.priceUnit * 100, 10) * this.number * 30) / 100
const { priceUnit, is_assign, is_auto, buy_quantity, monthQuantity } = this;
if(is_assign){
return (priceUnit * 100 * buy_quantity) / 100;
}
return (parseInt(this.priceUnit * 100, 10) * this.number) / 100;
if(is_auto){
return (priceUnit * 100 * monthQuantity * 30) / 100
}
return (priceUnit * 100 ) / 100;
}
},
mounted(){
console.log('query', this.query)
if(this.query.goods_type === '1'){
return this.getGoodsDetail('friendly');
}
@@ -212,6 +215,22 @@ export default {
},
methods: {
getSelectedSpec() {
if(this.query.goods_type === '2'){
// 随喜
if(this.is_assign){
return {
specId: '',
specName: this.data.rule_btn
}
}
const spec = this.data.spec.find(item => item.id === this.priceUnitId);
return {
specId: spec.id,
specName: spec.spec_name,
}
}
},
// 获取商品详情
/*
type = friendly: 获取日行一善商品
@@ -226,6 +245,7 @@ export default {
}
await this.getDynamicDataByGoodsId(goods_id);
this.data = response;
this.priceUnit = this.data.spec[0].donate_number * Number(this.data.price)
},
async getDynamicDataByGoodsId(goods_id){
const res = await getDynamicData(1, goods_id);
@@ -245,6 +265,7 @@ export default {
onPriceUnit({id, money}){
this.priceUnit = Number(money);
this.priceUnitId = id;
this.buy_quantity = 1;
if(this.query.goods_type === '2'){
this.is_assign = false;
}
@@ -257,9 +278,9 @@ export default {
...this.$route.query,
is_auto: this.is_auto ? 1 : 0,
spec_id: this.priceUnitId,
friendly_time: this.number,
friendly_time: this.monthQuantity,
title: this.title,
subTitle: this.data.name,
subTitle: this.data.spec.find(item => item.id === this.priceUnitId).spec_name,
amount: this.priceTotal,
is_customized: 0,
from: 'friendly_day', // 标识为日行一善
@@ -273,10 +294,11 @@ export default {
...this.$route.query,
is_auto: this.is_auto ? 1 : 0,
is_assign: this.is_assign ? 1 : 0,
spec_id: this.priceUnitId,
friendly_time: this.number,
title: this.title,
subTitle: this.data.name,
spec_id: this.getSelectedSpec().specId,
friendly_time: this.monthQuantity,
quantity: this.buy_quantity,
title: this.data.name,
subTitle: this.getSelectedSpec().specName,
amount: this.priceTotal,
is_customized: 0,
buy_quantity: this.buy_quantity,
@@ -425,6 +447,11 @@ export default {
.total{
font-size: .4rem;
em{
color: $primary-color;
font-size: .4rem;
font-weight: bold;
}
}
.next{
font-size: .4rem;
+3 -1
View File
@@ -141,9 +141,11 @@ export default {
border: none;
}
.input[type=textarea]{
min-height: 3rem;
min-height: 2rem;
width: calc(100% - .5rem);
padding-right: .5rem;
line-height: 1.4;
text-align: justify;
}
.icon-arrow-right{
position: absolute;
@@ -41,7 +41,7 @@
</template>
<script>
import { getDreamList } from '@/api';
import { getDreamList, getMeritName } from '@/api';
export default {
data(){
@@ -83,7 +83,10 @@ export default {
this.onConfirmMeritName();
},
async getName() {
const data = await getMeritName();
this.names = data;
},
//获取心愿列表
async getDreamList(){
const list = await getDreamList();
@@ -103,13 +106,11 @@ export default {
}
.add-name{
display: flex;
.input{
flex: 1;
height: .8rem;
line-height: .8rem;
padding-left: .3rem;
font-size: .35rem;
border: 1px solid #ddd;
border-radius: .11rem;
font-size: .4rem;
@@ -2,7 +2,6 @@
<span>
<ul class="spec-group">
<li class="border-circle" :class="[value === 'is_customized' && 'active']" @click="onAnyAmount">
<span>随喜参与法会</span>
<span>{{data.rule_btn}}</span>
</li>
<li class="border-circle" v-for="spec in data.spec" :key="spec.id" :class="[ value === spec.id && 'active']" @click="onSelectSpec(spec)">
+32 -26
View File
@@ -43,9 +43,9 @@
<div class="head">
<span>参与流程: </span>
<ul class="step-inline">
<li :class="[ current === 0 && 'current']" @click="current = 0">选择类型</li>
<li :class="[ current === 1 && 'current']" @click="current = 1">填写信息</li>
<li :class="[ current === 2 && 'current']" >参与成功</li>
<li :class="[ current === 0 && 'current']">选择类型</li>
<li :class="[ current === 1 && 'current']">填写信息</li>
<li :class="[ current === 2 && 'current']">参与成功</li>
</ul>
</div>
<transition>
@@ -55,7 +55,7 @@
</template>
</transition>
<div class="next-group">
<span class="total">合计:¥{{priceTotal}}</span>
<span class="total">合计:<em>¥{{priceTotal}}</em></span>
<button class="next" @click="onNextStep">下一步</button>
</div>
</div>
@@ -139,7 +139,7 @@ export default {
// 接收随喜金额
onReceiveAnyAmount(anyObj){
this.anyPrice = anyObj.money;
this.onNextStep();
this.onToFillMeritName();
},
// dreamInfo: 心愿信息
onDreamInfoChange(dreamInfo){
@@ -158,34 +158,35 @@ export default {
return;
}
this.current += 1;
if(this.current === 1 && this.spec_id === 'is_customized'){
if( this.spec_id === 'is_customized'){
this.showAnyAmount = true;
return ;
}
const selectedSpec = this.getSelectedSpec();
this.current += 1;
if(this.current > 0){
this.$router.push({
name: 'fill-name',
query: {
...this.query,
is_auto: this.is_auto ? 1 : 0,
spec_id: selectedSpec.id,
friendly_time: this.number,
quantity: this.quantity,
title: this.data.name,
subTitle: selectedSpec.spec_name,
amount: this.priceTotal,
// merit_name_id: ,
is_customized: 0,
from: 'common_goods', // 标识为通用商品
}
})
this.onToFillMeritName();
}
},
onToFillMeritName(){
const selectedSpec = this.getSelectedSpec();
this.$router.push({
name: 'fill-name',
query: {
...this.query,
is_auto: this.is_auto ? 1 : 0,
spec_id: selectedSpec.id,
friendly_time: this.number,
quantity: this.quantity,
title: this.data.name,
subTitle: selectedSpec.spec_name,
amount: this.priceTotal,
is_customized: this.spec_id === 'is_customized' ? 1 : 0,
from: 'common_goods', // 标识为通用商品
}
})
},
async getGoodsDetail(type){
const { goods_id, temple_id } = this.$route.query;
const response = await getGoodsDetail(type, goods_id, temple_id);
@@ -370,6 +371,11 @@ export default {
border-top: 1px solid #ededed;
.total{
font-size: .4rem;
em{
color: $primary-color;
font-size: .4rem;
font-weight: bold;
}
}
.next{
font-size: .4rem;
+22 -6
View File
@@ -28,20 +28,20 @@
</div>
</div>
<div class="divider"></div>
<div class="panel">
<div class="panel" v-if="data.common_data.length">
<div class="panel-head">
<span class="title">功德无量</span>
<arrow-more @click="$router.push({ name: 'merit-list', query: { temple_id: query.temple_id } })"></arrow-more>
</div>
<div class="panel-body">
<van-swipe class="merit-group" :width="140" :loop="false" :show-indicators="false">
<van-swipe-item v-for="goods in data.common_data" :key="goods.id">
<div class="merit" @click="onToGoods(goods)">
<div class="merit-scroll-container">
<div class="merit-scroll-wrapper">
<div class="merit" v-for="goods in data.common_data" :key="goods.id" @click="onToGoods(goods)">
<img :src="goods.cover_url" alt="" />
<p class="title">{{ goods.alias }}</p>
</div>
</van-swipe-item>
</van-swipe>
</div>
</div>
</div>
</div>
<div class="divider"></div>
@@ -67,17 +67,25 @@
import { getTempleIndex } from '@/api';
export default {
components: {
},
data() {
return {
query: this.$route.query,
value: '',
data: null,
mescrollDown: {},
mescrollUp: {},
mescroll: null,
};
},
mounted() {
this.getTempleIndex();
},
methods: {
mescrollInit(mescroll){
this.mescroll = mescroll;
},
onToGoods(goods){
this.$router.push({
name: 'goods-detail',
@@ -180,6 +188,14 @@ export default {
}
}
}
.merit-scroll-container{
margin: 0 .4rem;
height: 3.39rem;
overflow-x: auto;
.merit-scroll-wrapper{
white-space: nowrap;
}
}
.merit-group{
padding-bottom: .4rem;
}
+34 -8
View File
@@ -16,11 +16,11 @@
<b class="sub-title">{{info.unit_name}}</b>
</span>
<div class="list">
<span :class="[n.id === type_id && 'current']" v-for="n in nav" :key="n.id">{{n.title}}</span>
<span :class="[n.id === type_id && 'current']" v-for="(n, index) in nav" :key="n.id" @click="onListBy(n, index)">{{n.title}}</span>
</div>
</div>
<div class="body">
<swiper class="swiper-container" :options="SwiperOption" ref="swiper" @change="onSwiperChange">
<swiper class="swiper-container" :options="SwiperOption" ref="swiper" @swiper="onSwiper" @slideChange="onSlideChange">
<swiper-slide v-for="swipe in nav" :key="swipe.id">
<scroll-view
:height="containerHeight - 20"
@@ -45,8 +45,14 @@
<script>
import { getMeritBox } from "@/api";
import { swiper, swiperSlide } from 'vue-awesome-swiper';
export default {
components: {
swiper,
swiperSlide
},
data(){
return {
query: this.$route.query,
@@ -76,26 +82,46 @@ export default {
}
}
},
computed: {
swiper(){
return this.$refs.swiper.swiper;
}
},
mounted(){
this.width = window.innerWidth;
console.log(this.$refs.swiper)
this.containerHeight = this.$refs.swiper.$el.offsetHeight;
this.getMeritBox();
this.$nextTick(() => {
})
},
methods: {
onSwiperChange(e){
console.log(e)
},
onSwiper(swiper){
console.log('on swiper', swiper)
},
onSlideChange(){
const { activeIndex } = this.swiper;
const { id } = this.nav[activeIndex];
this.type_id = id;
this.getMeritBox()
},
async getMeritBox(){
const current = this.nav.find(item => item.id === this.type_id);
const res = await getMeritBox(this.query.temple_id || '1', current.id, current.page, current.size);
this.info = res.merit_box_info;
// this.list = res.merit_box_order.list;
this.total = res.merit_box_order.total;
current.list = res.merit_box_order.list
this.total = res.merit_box_order.total
const query = this.$utils.setSearchParamsFromObj({ ...this.$route.query, temple_id: this.info.temple_id });
if(!this.$route.query.temple_id){
history.pushState('', '', location.href + query)
}
},
onListBy(n, index){
this.type_id = n.id;
this.swiper.slideTo(index, 300, false)
this.getMeritBox();
},
loadMore(){
console.log('加载更多')
const current = this.nav.find(item => item.id === this.type_id);
+5 -3
View File
@@ -32,7 +32,8 @@
</div>
<div class="pay-button-container">
<van-button block type="primary" round class="pay-button" @click="onCreatePayOrder">确认支付</van-button>
<van-button v-if="query.order_id" block type="primary" round class="pay-button" @click="onContinuePayOrder">确认支付</van-button>
<van-button v-else block type="primary" round class="pay-button" @click="onCreatePayOrder">确认支付</van-button>
</div>
</div>
</div>
@@ -52,12 +53,14 @@ export default {
}
},
methods: {
onContinuePayOrder(){
this.onPayment({ id: this.query.order_id })
},
async onCreatePayOrder(){
// 创建日行一善支付订单
if(this.query.goods_type == '1'){
const request = {
...this.query,
}
const order = await createFriendlyDayOrder(request)
this.onPayment(order)
@@ -99,7 +102,6 @@ export default {
},
async onPayment(order){
console.log(order)
const result = await createPay(order.id);
const payResult = await requestPayment(result)
await this.$router.push({
+21 -2
View File
@@ -94,6 +94,8 @@
</div>
</div>
<button class="temple-station-in" @click="onTempleStation">寺院入驻</button>
</div>
<div class="panel-menu-btn" @click="showUserMenu = true">
@@ -101,6 +103,7 @@
<span class="menu-text">菜单</span>
</div>
<van-popup v-model="showUserMenu" position="left" style="width: 80%; height: 100%">
<div class="user-menu" v-if="user">
<div class="user">
@@ -158,7 +161,6 @@ export default {
},
async getUserData(){
const res = await getUserData();
console.log(res);
this.user = res;
},
onToGoods(goods) {
@@ -175,6 +177,9 @@ export default {
this.data = res;
this.data.icon_data = this.sliceNav(res.icon_data);
},
onTempleStation(){
this.$router.push({ name: 'user-temple-station'})
},
sliceNav(navData) {
const nav = [];
const slice = 8;
@@ -183,6 +188,7 @@ export default {
const b = navData.slice(i * slice, i * slice + slice);
nav.push(b);
}
return nav;
},
onMoreDynamic() {
@@ -196,6 +202,20 @@ export default {
.van-nav-bar__title {
color: white;
}
.temple-home-page{
.temple-station-in{
font-size: .4rem;
background: $primary-color;
color: white;
border: 1px solid $primary-color;
padding: .3rem .6rem;
border-radius: 1rem;
margin-left: auto;
margin-right: auto;
margin-top: 1rem;
display: block;
}
}
.van-popup {
.put-away {
@@ -474,7 +494,6 @@ export default {
.merit-group {
display: flex;
width: 11.36rem;
margin-bottom: .91rem;
}
}
}
+8 -8
View File
@@ -12,14 +12,14 @@
<span class="iconfont icon-dingwei"></span>
<span>重新定位</span>
</div>
<div class="show-mode" v-if="mode === 'list'" @click="onModeSwitch('map')">
<span>地图模式</span>
<span class="iconfont icon-ditu"></span>
</div>
<div class="show-mode" v-if="mode === 'map'" @click="onModeSwitch('list')">
<span>列表模式</span>
<span class="iconfont icon-liebiao"></span>
</div>
<!-- <div class="show-mode" v-if="mode === 'list'" @click="onModeSwitch('map')">-->
<!-- <span>地图模式</span>-->
<!-- <span class="iconfont icon-ditu"></span>-->
<!-- </div>-->
<!-- <div class="show-mode" v-if="mode === 'map'" @click="onModeSwitch('list')">-->
<!-- <span>列表模式</span>-->
<!-- <span class="iconfont icon-liebiao"></span>-->
<!-- </div>-->
</div>
</div>
<div >
+16 -7
View File
@@ -11,7 +11,7 @@
</div>
</template>
<template v-if="!authing">
<van-notice-bar ext="真实法师社区,法师身份认证审核通过后才能使用" />
<van-notice-bar text="真实法师社区,法师身份认证审核通过后才能使用" />
<van-form @submit="onSubmit">
<van-field
v-model="form.nickname"
@@ -66,7 +66,7 @@
placeholder="向他人展示自己的文字说明"
:rules="[{ required: true }]"
maxlength="500"
:rows="8"
:rows="4"
show-word-limit
/>
<div style="margin: 16px;">
@@ -120,9 +120,16 @@ export default {
this.getParams();
},
methods: {
async onSubmit(e){
console.log(e);
const [province_id, city_id, county_id] = this.form.city_id;
async onSubmit(){
const { form } = this;
const [province_id, city_id, county_id] = form.city_id;
const { avatar_url, cert_url } = form;
if(!avatar_url.length){
return this.$toast.fail('请上传头像照片');
}
if(!cert_url.length){
return this.$toast.fail('请上传戒牒照片')
}
const params = {
...this.form,
avatar_url: this.form.avatar_url[0].url,
@@ -134,7 +141,7 @@ export default {
await certifyMonk(params)
this.$toast.success('认证信息提交成功')
await this.$delay(2000)
this.$router.replace({ name: 'user-temple-station-review'})
await this.$router.replace({ name: 'user-temple-station-review'})
},
getParams(){
@@ -187,4 +194,6 @@ export default {
}
}
}
</style>
</style>
<!-- IE11 -->
+6
View File
@@ -15,6 +15,12 @@ const routes = [
meta: { title: '搜索' },
component: () => import('@/pages/search')
},
{
path: '/mescroll',
name: 'mescroll',
meta: { title: '上拉下刷' },
component: () => import('@/pages/mescroll-test')
},
{
path: '/temple',
meta: { title: '寺院', navBarBackgroundColor: 'white', showNavBar: false },
+9
View File
@@ -0,0 +1,9 @@
export default {
setSearchParamsFromObj(obj){
let search = '?';
for(let i in obj){
search += `${i}=${obj[i]}&`
}
return search.slice(0, -1);
}
}