fix: update
This commit is contained in:
@@ -35,6 +35,9 @@ const getRegion = async () => {
|
||||
// 寺院进驻
|
||||
const postTemple = data => service.post('/api/temple/settled', data);
|
||||
|
||||
// 寺院进驻协议
|
||||
const getTempleAgreement = () => service.get('/api/temple-agreement');
|
||||
|
||||
// 上传
|
||||
const uploadFile = data => service.post('/api/upload', data);
|
||||
|
||||
@@ -44,6 +47,12 @@ const certifyMonk = data => service.post('/api/master/certify', data);
|
||||
// 用户数据
|
||||
const getUserData = () => service.get('/api/get-user-data');
|
||||
|
||||
// 获取短信验证码
|
||||
const getMobileValidateCode = mobile => service.post('/api/send-sms', { mobile });
|
||||
|
||||
// 验证短信验证码
|
||||
const postMobileCode = (mobile, code) => service.post('/api/sms-validate', { mobile, code });
|
||||
|
||||
// 添砖加瓦日行一善商品
|
||||
const getGoodsDetail = (goods_type, goods_id, temple_id) => service.get(`/api/${goods_type}/get-info?id=${goods_id}&temple_id=${temple_id}`);
|
||||
|
||||
@@ -140,8 +149,11 @@ const getHotWords = () => service.get(`/api/keywords/get-list`);
|
||||
export {
|
||||
getHotWords,
|
||||
getMonkAppellation,
|
||||
postMobileCode,
|
||||
getRegion,
|
||||
getMobileValidateCode,
|
||||
postTemple,
|
||||
getTempleAgreement,
|
||||
uploadFile,
|
||||
certifyMonk,
|
||||
getUserData,
|
||||
|
||||
+6
-1
@@ -1,6 +1,7 @@
|
||||
import axios from 'axios';
|
||||
import { Toast } from 'vant';
|
||||
import qs from 'qs'
|
||||
import router from '../router';
|
||||
|
||||
const baseURL = process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_HOST
|
||||
|
||||
@@ -34,6 +35,10 @@ instance.interceptors.response.use(response => {
|
||||
location.href = '/api/wx/oauth'
|
||||
return
|
||||
}
|
||||
if(response.data.code === 1000023){
|
||||
Toast('请验证手机号')
|
||||
return router.push({ name: 'get-user-phone'});
|
||||
}
|
||||
if(response.data.code !== 0){
|
||||
Toast.fail(response.data.message)
|
||||
}
|
||||
@@ -44,4 +49,4 @@ instance.interceptors.response.use(response => {
|
||||
return Promise.reject(response);
|
||||
})
|
||||
|
||||
export default instance;
|
||||
export default instance;
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
<div class="order" @click="handleOrder">
|
||||
<div class="order-head">
|
||||
<span class="temple-name" @click.stop="onTemple">{{data.temple_name}}<i class="iconfont icon-arrow-right"></i></span>
|
||||
<span class="status">{{data.status}}</span>
|
||||
<span class="status">{{data.status_name}}</span>
|
||||
</div>
|
||||
<div class="order-body">
|
||||
<img class="goods-picture" :src="data.picture" alt="">
|
||||
<div class="order-flex">
|
||||
<h4 class="name">{{data.goods_name}}</h4>
|
||||
<span class="date">{{data.created_at}}</span>
|
||||
<span class="date" v-if="data.status === 1">{{data.created_at}}</span>
|
||||
<span class="date" v-else>{{data.paid_at}}</span>
|
||||
</div>
|
||||
<div class="order-flex-quantity">
|
||||
<span class="amount">¥ {{data.order_amount}}</span>
|
||||
|
||||
+2
-1
@@ -10,8 +10,9 @@ import './components/index'
|
||||
// swiper 样式全局引入, 组件页面引入。 Ref: https://www.jianshu.com/p/03f9fa94c474
|
||||
import 'swiper/css/swiper.css';
|
||||
import config from './config';
|
||||
import utils from './util'
|
||||
import utils from './util';
|
||||
|
||||
Vue.prototype.$bus = new Vue();
|
||||
Vue.mixin(globalMixin)
|
||||
Vue.config.productionTip = false
|
||||
Vue.prototype.$delay = delay;
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
<template>
|
||||
<div class="buddha-activity-scroll">
|
||||
<van-nav-bar left-arrow v-if="$route.meta.showNavBar" :title="$route.meta.title" @click-left="$router.back()" :style="{backgroundColor: $route.meta.navBarBackgroundColor}" />
|
||||
<div class="process-container">
|
||||
<!-- <scroll-view :height="height - 50" ref="scrollView">-->
|
||||
<!-- <buddha-process v-for="(p, i) in list" :key="i" :data="p" :show-goods-btn="!query.goods_id"></buddha-process>-->
|
||||
<!-- <div v-if="total === list.length && list.length > 3" class="no-more">没有更多了</div>-->
|
||||
<!-- </scroll-view>-->
|
||||
<!-- -->
|
||||
<div class="wrapper">
|
||||
<div class="content">
|
||||
<buddha-process v-for="(p, i) in list" :key="i" :data="p" :show-goods-btn="!query.goods_id"></buddha-process>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getDynamicData } from "@/api"
|
||||
import BScroll from 'better-scroll';
|
||||
|
||||
export default {
|
||||
props: ['data'],
|
||||
data(){
|
||||
const { query } = this.$route;
|
||||
return {
|
||||
query,
|
||||
size: 10,
|
||||
page: 1,
|
||||
total: 0,
|
||||
list: [],
|
||||
height: window.innerHeight,
|
||||
bScroll: null,
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
this.getDynamicData();
|
||||
|
||||
},
|
||||
methods: {
|
||||
initBetterScroll(){
|
||||
const THRESHOLD = 70
|
||||
const STOP = 56
|
||||
|
||||
this.bScroll = new BScroll('.wrapper', {
|
||||
pullDownRefresh: {
|
||||
threshold: THRESHOLD,
|
||||
stop: STOP
|
||||
},
|
||||
pullUpLoad: {
|
||||
threshold: THRESHOLD,
|
||||
stop: STOP,
|
||||
}
|
||||
});
|
||||
this.bScroll.refresh();
|
||||
this.bScroll.on('pullingDown', this.pullingDown)
|
||||
this.bScroll.on('pullingUp', this.pullUpLoad)
|
||||
},
|
||||
pullingDown(){
|
||||
this.bScroll.finishPullDown();
|
||||
this.bScroll.refresh()
|
||||
},
|
||||
pullUpLoad(){
|
||||
this.bScroll.finishPullUp()
|
||||
this.bScroll.refresh()
|
||||
},
|
||||
async getDynamicData(){
|
||||
const res = await getDynamicData(this.query.temple_id, this.page, this.query.goods_id, this.size)
|
||||
this.total = res.total;
|
||||
this.list = res.results;
|
||||
this.$nextTick(() => {
|
||||
this.initBetterScroll();
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.buddha-activity-scroll{
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
.process-container{
|
||||
overflow: hidden;
|
||||
height: calc(100vh - env(safe-area-inset-bottom));
|
||||
.wrapper{
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -36,7 +36,6 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getUserData } from '@/api';
|
||||
|
||||
export default {
|
||||
name: 'fill-name',
|
||||
@@ -61,9 +60,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
getUserData().then(data => {
|
||||
this.user = data;
|
||||
})
|
||||
|
||||
},
|
||||
methods: {
|
||||
onShowDialog(){
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
<template>
|
||||
<van-form @submit="onSubmit">
|
||||
<van-field
|
||||
v-model="mobile"
|
||||
name="手机号码"
|
||||
label="手机号"
|
||||
type="tel"
|
||||
placeholder="请输入手机号"
|
||||
:rules="[{ required: true, message: '请输入手机号' }]"
|
||||
>
|
||||
<template #extra>
|
||||
<van-button v-if="countdown === 0" type="primary" size="mini" native-type="button" @click.stop.prevent="onSendCode">发送验证码</van-button>
|
||||
<van-button v-else size="mini">{{countdown}}秒后重发</van-button>
|
||||
</template>
|
||||
</van-field>
|
||||
<van-field
|
||||
v-model="validCode"
|
||||
type="tel"
|
||||
name="验证码"
|
||||
label="验证码"
|
||||
placeholder="验证码"
|
||||
:rules="[{ required: true, message: '请填写密码' }]"
|
||||
/>
|
||||
<div style="margin: 16px;">
|
||||
<van-button round block type="info" native-type="submit">提交</van-button>
|
||||
</div>
|
||||
</van-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getMobileValidateCode, postMobileCode } from '@/api';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
mobile: '',
|
||||
validCode: '',
|
||||
countdown: 0,
|
||||
timer: null,
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
async onSubmit(values) {
|
||||
console.log('submit', values);
|
||||
const { mobile, validCode } = this;
|
||||
if(!mobile){
|
||||
return this.$toast('请输入手机号')
|
||||
}
|
||||
if(!validCode){
|
||||
return this.$toast('请输入验证码')
|
||||
}
|
||||
const res = await postMobileCode(mobile, validCode)
|
||||
if(res){
|
||||
this.$toast.success('验证成功')
|
||||
this.$delay(500);
|
||||
this.$router.back();
|
||||
this.$bus.$emit('updateMobile')
|
||||
}
|
||||
},
|
||||
onSendCode(){
|
||||
const { mobile } = this;
|
||||
if(!mobile){
|
||||
return this.$toast('请输入手机号')
|
||||
}
|
||||
|
||||
getMobileValidateCode(mobile).then(success => {
|
||||
if(success){
|
||||
this.$toast('发送成功,请注意查收短信');
|
||||
if(this.countdown === 0){
|
||||
this.countdown = 60;
|
||||
this.countdownSecond()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
countdownSecond(){
|
||||
this.timer = setInterval(() => {
|
||||
this.countdown --;
|
||||
if(this.countdown == 0){
|
||||
clearInterval(this.timer)
|
||||
}
|
||||
}, 1000)
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
|
||||
</style>
|
||||
@@ -62,7 +62,7 @@
|
||||
</van-popup>
|
||||
|
||||
<!-- 随喜金额-->
|
||||
<random-money :value.sync="showAnyAmount" @change="onReceiveAnyAmount"></random-money>
|
||||
<random-money v-if="showAnyAmount" :value.sync="showAnyAmount" @change="onReceiveAnyAmount"></random-money>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -0,0 +1,126 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--mescroll滚动区域的基本结构-->
|
||||
<mescroll-vue ref="mescroll" :down="mescrollDown" :up="mescrollUp" @init="mescrollInit">
|
||||
<!--内容...-->
|
||||
<div class="div" v-for="(v, i) in dataList" :key="i">{{v}}</div>
|
||||
</mescroll-vue>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
// 引入mescroll的vue组件
|
||||
import MescrollVue from 'mescroll.js/mescroll.vue'
|
||||
const axios = {
|
||||
current: 0,
|
||||
get(){
|
||||
return new Promise((resolve) => {
|
||||
this.current += 1;
|
||||
setTimeout(() => {
|
||||
console.log(this.current)
|
||||
if(this.current === 3){
|
||||
resolve({
|
||||
data: []
|
||||
})
|
||||
return
|
||||
}
|
||||
resolve({
|
||||
data: Array.from(Array(10), () => Math.random() * 100)
|
||||
})
|
||||
}, Math.random() * 1000)
|
||||
})
|
||||
}
|
||||
}
|
||||
export default {
|
||||
components: {
|
||||
MescrollVue // 注册mescroll组件
|
||||
},
|
||||
data () {
|
||||
return {
|
||||
data: [],
|
||||
mescroll: null, // mescroll实例对象
|
||||
mescrollDown:{}, //下拉刷新的配置. (如果下拉刷新和上拉加载处理的逻辑是一样的,则mescrollDown可不用写了)
|
||||
mescrollUp: { // 上拉加载的配置.
|
||||
callback: this.upCallback, // 上拉回调,此处简写; 相当于 callback: function(page, mescroll) { }
|
||||
//以下是一些常用的配置,当然不写也可以的.
|
||||
page: {
|
||||
num: 0, //当前页 默认0,回调之前会加1; 即callback(page)会从1开始
|
||||
size: 10 //每页数据条数,默认10
|
||||
},
|
||||
htmlNodata: '<p class="upwarp-nodata">-- END --</p>',
|
||||
noMoreSize: 5, //如果列表已无数据,可设置列表的总数量要大于5才显示无更多数据; 避免列表数据过少(比如只有一条数据),显示无更多数据会不好看这就是为什么无更多数据有时候不显示的原因
|
||||
toTop: {
|
||||
//回到顶部按钮
|
||||
src: "./static/mescroll/mescroll-totop.png", //图片路径,默认null,支持网络图
|
||||
offset: 1000 //列表滚动1000px才显示回到顶部按钮
|
||||
},
|
||||
empty: {
|
||||
//列表第一页无任何数据时,显示的空提示布局; 需配置warpId才显示
|
||||
warpId: "xxid", //父布局的id (1.3.5版本支持传入dom元素)
|
||||
icon: "./static/mescroll/mescroll-empty.png", //图标,默认null,支持网络图
|
||||
tip: "暂无相关数据~" //提示
|
||||
}
|
||||
},
|
||||
dataList: [] // 列表数据
|
||||
}
|
||||
},
|
||||
beforeRouteEnter (to, from, next) { // 如果没有配置顶部按钮或isBounce,则beforeRouteEnter不用写
|
||||
next(vm => {
|
||||
// 滚动到原来的列表位置,恢复顶部按钮和isBounce的配置
|
||||
vm.$refs.mescroll && vm.$refs.mescroll.beforeRouteEnter()
|
||||
})
|
||||
},
|
||||
beforeRouteLeave (to, from, next) { // 如果没有配置顶部按钮或isBounce,则beforeRouteLeave不用写
|
||||
// 记录列表滚动的位置,隐藏顶部按钮和isBounce的配置
|
||||
this.$refs.mescroll && this.$refs.mescroll.beforeRouteLeave()
|
||||
next()
|
||||
},
|
||||
methods: {
|
||||
// mescroll组件初始化的回调,可获取到mescroll对象
|
||||
mescrollInit (mescroll) {
|
||||
this.mescroll = mescroll // 如果this.mescroll对象没有使用到,则mescrollInit可以不用配置
|
||||
},
|
||||
// 上拉回调 page = {num:1, size:10}; num:当前页 ,默认从1开始; size:每页数据条数,默认10
|
||||
upCallback (page, mescroll) {
|
||||
|
||||
// 联网请求
|
||||
axios.get({
|
||||
params: {
|
||||
num: page.num, // 页码
|
||||
size: page.size // 每页长度
|
||||
}
|
||||
}).then((response) => {
|
||||
// 请求的列表数据
|
||||
let arr = response.data
|
||||
// 如果是第一页需手动置空列表
|
||||
if (page.num === 1) this.dataList = []
|
||||
// 把请求到的数据添加到列表
|
||||
this.dataList = this.dataList.concat(arr)
|
||||
// 数据渲染成功后,隐藏下拉刷新的状态
|
||||
this.$nextTick(() => {
|
||||
mescroll.endSuccess(arr.length)
|
||||
})
|
||||
}).catch(() => {
|
||||
// 联网失败的回调,隐藏下拉刷新和上拉加载的状态;
|
||||
mescroll.endErr()
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
/*通过fixed固定mescroll的高度*/
|
||||
.mescroll {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
bottom: 0;
|
||||
height: auto;
|
||||
}
|
||||
.div{
|
||||
height: 40px;
|
||||
background: red;
|
||||
border: 10px solid blue;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
</style>
|
||||
@@ -197,8 +197,6 @@ export default {
|
||||
color: white;
|
||||
}
|
||||
.temple-home-page{
|
||||
padding-bottom: 2rem;
|
||||
margin-bottom: env(safe-area-inset-bottom);
|
||||
.merit-scroll-container{
|
||||
height: 3.39rem;
|
||||
overflow-x: auto;
|
||||
@@ -218,6 +216,17 @@ export default {
|
||||
margin-top: 1rem;
|
||||
display: block;
|
||||
}
|
||||
.user-dynamic-container {
|
||||
margin-top: 0.5rem;
|
||||
height: 1.26rem;
|
||||
overflow: hidden;
|
||||
.van-swipe {
|
||||
height: 100%;
|
||||
}
|
||||
.van-swipe__indicators {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.van-popup {
|
||||
|
||||
@@ -30,6 +30,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created(){
|
||||
this.wechatReady()
|
||||
this.getCertList();
|
||||
},
|
||||
computed: {
|
||||
@@ -124,4 +125,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
<div class="tab-order" @click="$router.push('/user/order?current=1')">
|
||||
<span class="iconfont icon-qianbao"></span>
|
||||
<p>待支付</p>
|
||||
<b class="badge">1</b>
|
||||
<b class="badge">{{data.not_paid_sum}}</b>
|
||||
</div>
|
||||
<div class="tab-order" @click="$router.push('/user/order?current=2')">
|
||||
<span class="iconfont icon-dingdanchulizhong"></span>
|
||||
@@ -41,7 +41,7 @@
|
||||
<span class="iconfont icon-yichuli"></span>
|
||||
<p>已处理</p>
|
||||
</div>
|
||||
<div class="tab-order" @click="$router.push('/user/order?current=4')">
|
||||
<div class="tab-order" @click="$router.push('/user/order?current=0')">
|
||||
<span class="iconfont icon-quanbudingdan"></span>
|
||||
<p>全部订单</p>
|
||||
</div>
|
||||
@@ -226,4 +226,4 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</style>
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
<template>
|
||||
<div class="agreement" v-html="agreement"> </div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getTempleAgreement } from '@/api';
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
agreement: ''
|
||||
}
|
||||
},
|
||||
created(){
|
||||
getTempleAgreement().then(res => {
|
||||
this.agreement = res.content;
|
||||
})
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.agreement{
|
||||
padding: .3rem;
|
||||
*{
|
||||
font-size: .35rem;
|
||||
line-height: 1.8;
|
||||
color: #333;
|
||||
text-align: justify;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -28,7 +28,9 @@
|
||||
<p class="attention">寺院联盟认证将谨慎、严格的验证真实性,能够更好地保护寺院及用户的合法权益。</p>
|
||||
<p class="attention">认证资料仅在寺院联盟后台进行备注和核实信息使用,通过认证后将展示在认证页面。</p>
|
||||
<div class="agreement">
|
||||
<van-checkbox v-model="agreement">同意寺院联盟服务协议</van-checkbox>
|
||||
<van-checkbox v-model="agreement">
|
||||
<span @click.stop="onAgreement">同意自在福田服务协议</span>
|
||||
</van-checkbox>
|
||||
</div>
|
||||
<van-button type="warning" :disabled="!canNextStep2" block @click="onNextStep">下一步</van-button>
|
||||
</div>
|
||||
@@ -197,6 +199,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onAgreement(){
|
||||
this.$router.push({ name: 'user-temple-station-agreement' })
|
||||
},
|
||||
handleErrors(errors){
|
||||
for(let i = 0; i < errors.length; i++){
|
||||
if(errors[i]){
|
||||
|
||||
@@ -105,6 +105,12 @@ const routes = [
|
||||
meta: { title: '参与成功', navBarBackgroundColor: 'white' },
|
||||
component: () => import('@/pages/join-cert')
|
||||
},
|
||||
{
|
||||
path: '/get-user-phone',
|
||||
name: 'get-user-phone',
|
||||
meta: { title: '自在福田', navBarBackgroundColor: 'white' },
|
||||
component: () => import('@/pages/get-user-phone')
|
||||
},
|
||||
{
|
||||
path: '/goods-detail',
|
||||
name: 'goods-detail',
|
||||
@@ -145,6 +151,12 @@ const routes = [
|
||||
meta: { title: '寺院入驻', showNavBar: false },
|
||||
component: () => import('@/pages/user/temple-station')
|
||||
},
|
||||
{
|
||||
path: 'temple-station-agreement',
|
||||
name: 'user-temple-station-agreement',
|
||||
meta: { title: '寺院入驻协议', showNavBar: false },
|
||||
component: () => import('@/pages/user/temple-station-agreement')
|
||||
},
|
||||
{
|
||||
path: 'temple-station-review',
|
||||
name: 'user-temple-station-review',
|
||||
|
||||
Reference in New Issue
Block a user