修正佛前供灯bug
This commit is contained in:
+5
-1
@@ -161,7 +161,11 @@ const getStationTemplate = template_id => service.get(`/api/temple-template-shar
|
||||
// 平台首页
|
||||
const getPlatformHome = agent_id => service.get(`/api/home?agent_id=${agent_id}`)
|
||||
|
||||
// 查询是否登录
|
||||
const hasLogin = () => service.get('/api/has-login');
|
||||
|
||||
export {
|
||||
hasLogin,
|
||||
getHotWords,
|
||||
getMonkAppellation,
|
||||
postMobileCode,
|
||||
@@ -206,5 +210,5 @@ export {
|
||||
getCustomerList,
|
||||
getCertList,
|
||||
getStationTemplate,
|
||||
getPlatformHome
|
||||
getPlatformHome,
|
||||
}
|
||||
|
||||
+5
-1
@@ -2,6 +2,7 @@ import axios from 'axios';
|
||||
import { Toast } from 'vant';
|
||||
import qs from 'qs'
|
||||
import router from '../router';
|
||||
import utils from '../util'
|
||||
|
||||
const baseURL = process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_HOST
|
||||
|
||||
@@ -13,10 +14,13 @@ const instance = axios.create({
|
||||
"Accept": "*",
|
||||
"Content-Type": "application/x-www-form-urlencoded"
|
||||
},
|
||||
|
||||
})
|
||||
|
||||
instance.interceptors.request.use(request => {
|
||||
const { query } = router.currentRoute;
|
||||
if(query.no_login){
|
||||
request.url = utils.addExternalParamsToQuery(request.url, 'no_login', 1)
|
||||
}
|
||||
if(request.url.includes('upload')){
|
||||
return request
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
let wechatInstance;
|
||||
import util from "@/util";
|
||||
|
||||
function signToWechat(config, shareConfig) {
|
||||
if (!wx) {
|
||||
@@ -27,7 +28,7 @@ function signToWechat(config, shareConfig) {
|
||||
wx.onMenuShareAppMessage({
|
||||
title: shareConfig.title,
|
||||
desc: shareConfig.desc,
|
||||
link: shareConfig.link,
|
||||
link: util.addExternalParamsToQuery(shareConfig.link, 'no_login', 1),
|
||||
imgUrl: shareConfig.imgUrl,
|
||||
complete: res => {
|
||||
shareConfig.callback && shareConfig.callback({
|
||||
@@ -40,7 +41,7 @@ function signToWechat(config, shareConfig) {
|
||||
// // 分享朋友圈
|
||||
wx.onMenuShareTimeline({
|
||||
title: shareConfig.title,
|
||||
link: shareConfig.link,
|
||||
link: util.addExternalParamsToQuery(shareConfig.link, 'no_login', 1),
|
||||
imgUrl: shareConfig.imgUrl,
|
||||
complete: res => {
|
||||
shareConfig.callback && shareConfig.callback({
|
||||
|
||||
@@ -98,11 +98,11 @@ export default {
|
||||
}
|
||||
const res = await postMobileCode(mobile, validCode.join(''))
|
||||
if(res){
|
||||
this.$toast.success('验证成功')
|
||||
this.$toast.success('登记成功,请继续后续操作')
|
||||
this.$delay(500);
|
||||
// this.$router.back();
|
||||
this.$bus.$emit('updateMobile')
|
||||
this.$router.replace({ name: 'user-home'})
|
||||
this.$router.back();
|
||||
// this.$router.replace({ name: 'user-home'})
|
||||
}
|
||||
},
|
||||
onSendCode(){
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
</div>
|
||||
|
||||
<fixed-bottom ref="fixedBottom">
|
||||
<button class="merit-button" @click="showSpec = true">点击供灯</button>
|
||||
<button class="merit-button" @click="onLightAction">点击供灯</button>
|
||||
</fixed-bottom>
|
||||
|
||||
<van-popup v-model="showSpec" position="bottom" closeable :style="{ height: 'auto' }" safe-area-inset-bottom :close-on-click-overlay="false" :close-on-popstate="true">
|
||||
@@ -101,7 +101,7 @@
|
||||
<script>
|
||||
import 'swiper/css/swiper.css'
|
||||
import { swiper, swiperSlide } from 'vue-awesome-swiper'
|
||||
import { getGoodsLightDetail, getOrderCompare } from '@/api';
|
||||
import { getGoodsLightDetail, getOrderCompare, hasLogin } from "@/api";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -142,7 +142,7 @@ export default {
|
||||
payList: [],
|
||||
currentLight: null,
|
||||
currentLightPrice: 0,
|
||||
currentLightSize: '',
|
||||
currentLightSize: 53,
|
||||
buy_quantity: 1, // 购买数量
|
||||
}
|
||||
},
|
||||
@@ -159,7 +159,7 @@ export default {
|
||||
const len = Math.ceil(goods.length / 15);
|
||||
const lights = [];
|
||||
for(let i = 0; i < len; i++){
|
||||
lights.push(goods.slice(0 * i, 0 * i + 15))
|
||||
lights.push(goods.slice(15 * i, i * 15 + 15))
|
||||
}
|
||||
return lights;
|
||||
},
|
||||
@@ -172,10 +172,14 @@ export default {
|
||||
this.getGoodsLightDetail('common');
|
||||
},
|
||||
methods: {
|
||||
async onLightAction(){
|
||||
await hasLogin();
|
||||
this.showSpec = true
|
||||
},
|
||||
// 选择供灯种类
|
||||
onSelectLight(light){
|
||||
this.currentLight = light;
|
||||
this.currentLightSize = ''
|
||||
this.currentLightSize = light.children[0].id;
|
||||
},
|
||||
// 接收随喜金额
|
||||
onReceiveAnyAmount(anyObj){
|
||||
@@ -218,6 +222,7 @@ export default {
|
||||
const response = await getGoodsLightDetail(type, goods_id, temple_id);
|
||||
this.data = response;
|
||||
this.currentLight = response.goods[0];
|
||||
this.currentLightSize = this.currentLight.children[0].id
|
||||
await this.getPayRecords({ id: 1});
|
||||
this.$nextTick(() => {
|
||||
this.paddingBottom = this.$refs.fixedBottom.getOffsetHeight()
|
||||
@@ -238,7 +243,7 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
$lightWidth: 1.3rem;
|
||||
$lightWidth: 1.5rem;
|
||||
.goods-detail{
|
||||
.goods-content{
|
||||
padding-left: .3rem;
|
||||
@@ -251,7 +256,7 @@ $lightWidth: 1.3rem;
|
||||
.light-container{
|
||||
padding-left: .4rem;
|
||||
padding-right: .4rem;
|
||||
max-height: 10rem;
|
||||
max-height: 13rem;
|
||||
overflow: auto;
|
||||
.light-wrapper{
|
||||
border-top: 1px solid #ddd;
|
||||
@@ -266,6 +271,14 @@ $lightWidth: 1.3rem;
|
||||
text-align: center;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
.van-swipe{
|
||||
padding-bottom: .5rem;
|
||||
}
|
||||
.van-grid-item__content{
|
||||
padding-bottom: 0;
|
||||
padding-left: 0;
|
||||
padding-right: 0;
|
||||
}
|
||||
.current-light{
|
||||
border: 1px solid $primary-color;
|
||||
border-radius: 4px;
|
||||
@@ -279,12 +292,11 @@ $lightWidth: 1.3rem;
|
||||
vertical-align: top;
|
||||
}
|
||||
span{
|
||||
font-size: .4rem;
|
||||
font-size: .35rem;
|
||||
display: block;
|
||||
text-align: center;
|
||||
padding-top: .3rem;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
@@ -306,16 +318,16 @@ $lightWidth: 1.3rem;
|
||||
font-size: .4rem;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-top: .6rem;
|
||||
align-items: center;
|
||||
margin-bottom: .65rem;
|
||||
span{
|
||||
color: black;
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
.light-size{
|
||||
margin-top: 1.1rem;
|
||||
margin-top: .4rem;
|
||||
margin-bottom: .4rem;
|
||||
|
||||
.van-radio__label{
|
||||
margin-left: 4px;
|
||||
font-size: .35rem;
|
||||
@@ -328,7 +340,7 @@ $lightWidth: 1.3rem;
|
||||
}
|
||||
.light-count{
|
||||
align-items: center;
|
||||
margin-bottom: .2rem;
|
||||
margin-bottom: .5rem;
|
||||
}
|
||||
}
|
||||
.support{
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="merit-button-group" :style="{bottom: tabHeight + 'px'}">
|
||||
<button class="iconfont icon-arrow-left" @click="back"></button>
|
||||
<button class="merit-button" @click="openBox">随喜功德</button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -100,6 +101,9 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
back(){
|
||||
this.$router.push({ name: 'home', query: { temple_id: this.query.temple_id } })
|
||||
},
|
||||
openBox(){
|
||||
this.randVisible = true
|
||||
},
|
||||
@@ -234,19 +238,38 @@ export default {
|
||||
right: 0;
|
||||
background: white;
|
||||
padding-top: .2rem;
|
||||
padding-bottom: .2rem;
|
||||
padding-bottom: calc(.2rem + env(safe-area-inset-bottom));
|
||||
border-top: .01rem solid #ddd;
|
||||
display: flex;
|
||||
padding-left: .4rem;
|
||||
padding-right: .4rem;
|
||||
.iconfont{
|
||||
width: 20%;
|
||||
background: white;
|
||||
border: 1px solid #ddd;
|
||||
margin-right: .4rem;
|
||||
border-radius: 4px;
|
||||
font-size: .6rem;
|
||||
}
|
||||
.merit-button{
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
background: $primary-color;
|
||||
color: white;
|
||||
height: .93rem;
|
||||
font-size: .37rem;
|
||||
padding: 0 2rem;
|
||||
border: .01rem solid $primary-color;
|
||||
border-radius: $btn-border-radius;
|
||||
//display: inline-block;
|
||||
//vertical-align: top;
|
||||
//background: $primary-color;
|
||||
//color: white;
|
||||
//height: 1.4rem;
|
||||
//font-size: .37rem;
|
||||
//padding: 0 2rem;
|
||||
//border: .01rem solid $primary-color;
|
||||
//border-radius: $btn-border-radius;
|
||||
//flex: 1;
|
||||
|
||||
flex: 1;
|
||||
font-size: .4rem;
|
||||
padding: .3rem 1rem;
|
||||
background: $primary-color;
|
||||
border: 1px solid $primary-color;
|
||||
color: white;
|
||||
border-radius: .1rem;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,5 +5,16 @@ export default {
|
||||
search += `${i}=${obj[i]}&`
|
||||
}
|
||||
return search.slice(0, -1);
|
||||
},
|
||||
addExternalParamsToQuery(url, key, value){
|
||||
const hasQuery = url.indexOf('?') > -1
|
||||
url = url.split('?')
|
||||
const before = url.shift()
|
||||
let after = url.join('&')
|
||||
const searchParams = new URLSearchParams(after);
|
||||
if(!searchParams.has(key)){
|
||||
return before+'?'+after+'&'+key+'='+value;
|
||||
}
|
||||
return before+(hasQuery ? '?': '&') + after;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user