修正佛前供灯bug

This commit is contained in:
2022-03-10 14:19:36 +08:00
parent 845576c19b
commit 5b46a4c37e
9 changed files with 88 additions and 33 deletions
+2 -2
View File
@@ -1,4 +1,4 @@
# VUE_APP_HOST=https://test-temple.wdx-tc.com/ VUE_APP_HOST=https://test-temple.wdx-tc.com/
VUE_APP_HOST=https://demo.6bsq.com/ # VUE_APP_HOST=https://demo.6bsq.com/
NODE_ENV = development NODE_ENV = development
VUE_APP_TMAP_KEY=ZFGBZ-76ICF-BG5JY-NH4HX-MQOOJ-VJB4E VUE_APP_TMAP_KEY=ZFGBZ-76ICF-BG5JY-NH4HX-MQOOJ-VJB4E
+5 -1
View File
@@ -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 getPlatformHome = agent_id => service.get(`/api/home?agent_id=${agent_id}`)
// 查询是否登录
const hasLogin = () => service.get('/api/has-login');
export { export {
hasLogin,
getHotWords, getHotWords,
getMonkAppellation, getMonkAppellation,
postMobileCode, postMobileCode,
@@ -206,5 +210,5 @@ export {
getCustomerList, getCustomerList,
getCertList, getCertList,
getStationTemplate, getStationTemplate,
getPlatformHome getPlatformHome,
} }
+5 -1
View File
@@ -2,6 +2,7 @@ import axios from 'axios';
import { Toast } from 'vant'; import { Toast } from 'vant';
import qs from 'qs' import qs from 'qs'
import router from '../router'; import router from '../router';
import utils from '../util'
const baseURL = process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_HOST const baseURL = process.env.NODE_ENV === 'development' ? '/' : process.env.VUE_APP_HOST
@@ -13,10 +14,13 @@ const instance = axios.create({
"Accept": "*", "Accept": "*",
"Content-Type": "application/x-www-form-urlencoded" "Content-Type": "application/x-www-form-urlencoded"
}, },
}) })
instance.interceptors.request.use(request => { 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')){ if(request.url.includes('upload')){
return request return request
} }
+3 -2
View File
@@ -1,4 +1,5 @@
let wechatInstance; let wechatInstance;
import util from "@/util";
function signToWechat(config, shareConfig) { function signToWechat(config, shareConfig) {
if (!wx) { if (!wx) {
@@ -27,7 +28,7 @@ function signToWechat(config, shareConfig) {
wx.onMenuShareAppMessage({ wx.onMenuShareAppMessage({
title: shareConfig.title, title: shareConfig.title,
desc: shareConfig.desc, desc: shareConfig.desc,
link: shareConfig.link, link: util.addExternalParamsToQuery(shareConfig.link, 'no_login', 1),
imgUrl: shareConfig.imgUrl, imgUrl: shareConfig.imgUrl,
complete: res => { complete: res => {
shareConfig.callback && shareConfig.callback({ shareConfig.callback && shareConfig.callback({
@@ -40,7 +41,7 @@ function signToWechat(config, shareConfig) {
// // 分享朋友圈 // // 分享朋友圈
wx.onMenuShareTimeline({ wx.onMenuShareTimeline({
title: shareConfig.title, title: shareConfig.title,
link: shareConfig.link, link: util.addExternalParamsToQuery(shareConfig.link, 'no_login', 1),
imgUrl: shareConfig.imgUrl, imgUrl: shareConfig.imgUrl,
complete: res => { complete: res => {
shareConfig.callback && shareConfig.callback({ shareConfig.callback && shareConfig.callback({
+3 -3
View File
@@ -98,11 +98,11 @@ export default {
} }
const res = await postMobileCode(mobile, validCode.join('')) const res = await postMobileCode(mobile, validCode.join(''))
if(res){ if(res){
this.$toast.success('验证成功') this.$toast.success('登记成功,请继续后续操作')
this.$delay(500); this.$delay(500);
// this.$router.back();
this.$bus.$emit('updateMobile') this.$bus.$emit('updateMobile')
this.$router.replace({ name: 'user-home'}) this.$router.back();
// this.$router.replace({ name: 'user-home'})
} }
}, },
onSendCode(){ onSendCode(){
+25 -13
View File
@@ -42,7 +42,7 @@
</div> </div>
<fixed-bottom ref="fixedBottom"> <fixed-bottom ref="fixedBottom">
<button class="merit-button" @click="showSpec = true">点击供灯</button> <button class="merit-button" @click="onLightAction">点击供灯</button>
</fixed-bottom> </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"> <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> <script>
import 'swiper/css/swiper.css' import 'swiper/css/swiper.css'
import { swiper, swiperSlide } from 'vue-awesome-swiper' import { swiper, swiperSlide } from 'vue-awesome-swiper'
import { getGoodsLightDetail, getOrderCompare } from '@/api'; import { getGoodsLightDetail, getOrderCompare, hasLogin } from "@/api";
export default { export default {
components: { components: {
@@ -142,7 +142,7 @@ export default {
payList: [], payList: [],
currentLight: null, currentLight: null,
currentLightPrice: 0, currentLightPrice: 0,
currentLightSize: '', currentLightSize: 53,
buy_quantity: 1, // 购买数量 buy_quantity: 1, // 购买数量
} }
}, },
@@ -159,7 +159,7 @@ export default {
const len = Math.ceil(goods.length / 15); const len = Math.ceil(goods.length / 15);
const lights = []; const lights = [];
for(let i = 0; i < len; i++){ 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; return lights;
}, },
@@ -172,10 +172,14 @@ export default {
this.getGoodsLightDetail('common'); this.getGoodsLightDetail('common');
}, },
methods: { methods: {
async onLightAction(){
await hasLogin();
this.showSpec = true
},
// 选择供灯种类 // 选择供灯种类
onSelectLight(light){ onSelectLight(light){
this.currentLight = light; this.currentLight = light;
this.currentLightSize = '' this.currentLightSize = light.children[0].id;
}, },
// 接收随喜金额 // 接收随喜金额
onReceiveAnyAmount(anyObj){ onReceiveAnyAmount(anyObj){
@@ -218,6 +222,7 @@ export default {
const response = await getGoodsLightDetail(type, goods_id, temple_id); const response = await getGoodsLightDetail(type, goods_id, temple_id);
this.data = response; this.data = response;
this.currentLight = response.goods[0]; this.currentLight = response.goods[0];
this.currentLightSize = this.currentLight.children[0].id
await this.getPayRecords({ id: 1}); await this.getPayRecords({ id: 1});
this.$nextTick(() => { this.$nextTick(() => {
this.paddingBottom = this.$refs.fixedBottom.getOffsetHeight() this.paddingBottom = this.$refs.fixedBottom.getOffsetHeight()
@@ -238,7 +243,7 @@ export default {
</script> </script>
<style lang="scss"> <style lang="scss">
$lightWidth: 1.3rem; $lightWidth: 1.5rem;
.goods-detail{ .goods-detail{
.goods-content{ .goods-content{
padding-left: .3rem; padding-left: .3rem;
@@ -251,7 +256,7 @@ $lightWidth: 1.3rem;
.light-container{ .light-container{
padding-left: .4rem; padding-left: .4rem;
padding-right: .4rem; padding-right: .4rem;
max-height: 10rem; max-height: 13rem;
overflow: auto; overflow: auto;
.light-wrapper{ .light-wrapper{
border-top: 1px solid #ddd; border-top: 1px solid #ddd;
@@ -266,6 +271,14 @@ $lightWidth: 1.3rem;
text-align: center; text-align: center;
border: 1px solid transparent; border: 1px solid transparent;
} }
.van-swipe{
padding-bottom: .5rem;
}
.van-grid-item__content{
padding-bottom: 0;
padding-left: 0;
padding-right: 0;
}
.current-light{ .current-light{
border: 1px solid $primary-color; border: 1px solid $primary-color;
border-radius: 4px; border-radius: 4px;
@@ -279,12 +292,11 @@ $lightWidth: 1.3rem;
vertical-align: top; vertical-align: top;
} }
span{ span{
font-size: .4rem; font-size: .35rem;
display: block; display: block;
text-align: center; text-align: center;
padding-top: .3rem; padding-top: .3rem;
white-space: nowrap; white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden; overflow: hidden;
} }
} }
@@ -306,16 +318,16 @@ $lightWidth: 1.3rem;
font-size: .4rem; font-size: .4rem;
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
margin-top: .6rem;
align-items: center; align-items: center;
margin-bottom: .65rem;
span{ span{
color: black; color: black;
opacity: 1; opacity: 1;
} }
} }
.light-size{ .light-size{
margin-top: 1.1rem; margin-top: .4rem;
margin-bottom: .4rem;
.van-radio__label{ .van-radio__label{
margin-left: 4px; margin-left: 4px;
font-size: .35rem; font-size: .35rem;
@@ -328,7 +340,7 @@ $lightWidth: 1.3rem;
} }
.light-count{ .light-count{
align-items: center; align-items: center;
margin-bottom: .2rem; margin-bottom: .5rem;
} }
} }
.support{ .support{
+33 -10
View File
@@ -36,6 +36,7 @@
</div> </div>
</div> </div>
<div class="merit-button-group" :style="{bottom: tabHeight + 'px'}"> <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> <button class="merit-button" @click="openBox">随喜功德</button>
</div> </div>
</div> </div>
@@ -100,6 +101,9 @@ export default {
} }
}, },
methods: { methods: {
back(){
this.$router.push({ name: 'home', query: { temple_id: this.query.temple_id } })
},
openBox(){ openBox(){
this.randVisible = true this.randVisible = true
}, },
@@ -234,19 +238,38 @@ export default {
right: 0; right: 0;
background: white; background: white;
padding-top: .2rem; padding-top: .2rem;
padding-bottom: .2rem; padding-bottom: calc(.2rem + env(safe-area-inset-bottom));
border-top: .01rem solid #ddd; 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{ .merit-button{
display: inline-block; //display: inline-block;
vertical-align: top; //vertical-align: top;
background: $primary-color; //background: $primary-color;
color: white; //color: white;
height: .93rem; //height: 1.4rem;
font-size: .37rem; //font-size: .37rem;
padding: 0 2rem; //padding: 0 2rem;
border: .01rem solid $primary-color; //border: .01rem solid $primary-color;
border-radius: $btn-border-radius; //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;
} }
} }
} }
+11
View File
@@ -5,5 +5,16 @@ export default {
search += `${i}=${obj[i]}&` search += `${i}=${obj[i]}&`
} }
return search.slice(0, -1); 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;
} }
} }
+1 -1
View File
File diff suppressed because one or more lines are too long