修正日行一善
This commit is contained in:
@@ -1,3 +1,3 @@
|
|||||||
VUE_APP_HOST=https://test-temple.wdx-tc.com/
|
VUE_APP_HOST=https://test-temple.wdx-tc.com/
|
||||||
VUE_APP_TMAP_KEY=ZFGBZ-76ICF-BG5JY-NH4HX-MQOOJ-VJB4E
|
VUE_APP_TMAP_KEY=ZFGBZ-76ICF-BG5JY-NH4HX-MQOOJ-VJB4E
|
||||||
NODE_ENV = test
|
NODE_ENV=production
|
||||||
|
|||||||
+3
-2
@@ -4,7 +4,7 @@
|
|||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"serve": "vue-cli-service serve --mode development",
|
"serve": "vue-cli-service serve --mode development",
|
||||||
"build:test": "vue-cli-service build --mode production",
|
"build:test": "vue-cli-service build --mode test",
|
||||||
"build": "vue-cli-service build --mode production",
|
"build": "vue-cli-service build --mode production",
|
||||||
"lint": "vue-cli-service lint"
|
"lint": "vue-cli-service lint"
|
||||||
},
|
},
|
||||||
@@ -22,7 +22,8 @@
|
|||||||
"vant": "^2.12.30",
|
"vant": "^2.12.30",
|
||||||
"vue": "^2.6.11",
|
"vue": "^2.6.11",
|
||||||
"vue-awesome-swiper": "3.1.3",
|
"vue-awesome-swiper": "3.1.3",
|
||||||
"vue-router": "^3.5.3"
|
"vue-router": "^3.5.3",
|
||||||
|
"vuex": "^3.6.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@vue/cli-plugin-babel": "~4.5.0",
|
"@vue/cli-plugin-babel": "~4.5.0",
|
||||||
|
|||||||
+6
-3
@@ -1,11 +1,14 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="">
|
<html lang="" manifest="IGNORE.manifest">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta http-equiv="Expires" content="0">
|
|
||||||
<meta http-equiv="Pragma" content="no-cache">
|
<meta http-equiv="Pragma" content="no-cache">
|
||||||
<meta http-equiv="Cache-control" content="no-cache,must-revalidate">
|
|
||||||
<meta http-equiv="Cache" content="no-cache">
|
<meta http-equiv="Cache" content="no-cache">
|
||||||
|
<meta http-equiv="Cache-control" content="no-cache,must-revalidate">
|
||||||
|
<meta http-equiv="cache-control" content="max-age=0" />
|
||||||
|
<meta http-equiv="cache-control" content="no-cache" />
|
||||||
|
<meta http-equiv="expires" content="0" />
|
||||||
|
<meta http-equiv="expires" content="Tue, 01 Jan 1980 1:00:00 GMT" />
|
||||||
<meta name="referrer" content="never">
|
<meta name="referrer" content="never">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||||
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
|
<meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
|
||||||
|
|||||||
@@ -50,7 +50,6 @@ export default {
|
|||||||
handler() {
|
handler() {
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
const { tabbar } = this.$refs;
|
const { tabbar } = this.$refs;
|
||||||
console.log(tabbar)
|
|
||||||
this.tabHeight = tabbar ? tabbar.$el.offsetHeight - safeAreaInsets.bottom: 0;
|
this.tabHeight = tabbar ? tabbar.$el.offsetHeight - safeAreaInsets.bottom: 0;
|
||||||
console.log(this.tabHeight, )
|
console.log(this.tabHeight, )
|
||||||
})
|
})
|
||||||
|
|||||||
+5
-1
@@ -146,6 +146,9 @@ const getCertList = () => service.get(`/api/user/get-cert-list`);
|
|||||||
// 热门搜索
|
// 热门搜索
|
||||||
const getHotWords = () => service.get(`/api/keywords/get-list`);
|
const getHotWords = () => service.get(`/api/keywords/get-list`);
|
||||||
|
|
||||||
|
// 获取入驻模板
|
||||||
|
const getStationTemplate = template_id => service.get(`/api/temple-template-share?id=${template_id}`);
|
||||||
|
|
||||||
export {
|
export {
|
||||||
getHotWords,
|
getHotWords,
|
||||||
getMonkAppellation,
|
getMonkAppellation,
|
||||||
@@ -186,5 +189,6 @@ export {
|
|||||||
getOrderList,
|
getOrderList,
|
||||||
getOrder,
|
getOrder,
|
||||||
getCustomerList,
|
getCustomerList,
|
||||||
getCertList
|
getCertList,
|
||||||
|
getStationTemplate
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ const instance = axios.create({
|
|||||||
baseURL,
|
baseURL,
|
||||||
timeout: 15000,
|
timeout: 15000,
|
||||||
headers: {
|
headers: {
|
||||||
|
"env": process.env.NODE_ENV,
|
||||||
"Accept": "*",
|
"Accept": "*",
|
||||||
"Content-Type": "application/x-www-form-urlencoded"
|
"Content-Type": "application/x-www-form-urlencoded"
|
||||||
},
|
},
|
||||||
|
|||||||
+3
-1
@@ -28,12 +28,14 @@ import {
|
|||||||
Cascader,
|
Cascader,
|
||||||
ActionSheet,
|
ActionSheet,
|
||||||
ShareSheet,
|
ShareSheet,
|
||||||
|
Loading,
|
||||||
Dialog,
|
Dialog,
|
||||||
Icon
|
Icon
|
||||||
} from "vant";
|
} from "vant";
|
||||||
|
|
||||||
Vue.use(Button);
|
|
||||||
Vue.use(NavBar);
|
Vue.use(NavBar);
|
||||||
|
Vue.use(Button);
|
||||||
|
Vue.use(Loading);
|
||||||
Vue.use(Icon);
|
Vue.use(Icon);
|
||||||
Vue.use(Search);
|
Vue.use(Search);
|
||||||
Vue.use(Swipe);
|
Vue.use(Swipe);
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ export default {
|
|||||||
}
|
}
|
||||||
.username-container{
|
.username-container{
|
||||||
padding-top: .3rem;
|
padding-top: .3rem;
|
||||||
height: 2rem;
|
height: 1rem;
|
||||||
.username{
|
.username{
|
||||||
color: white;
|
color: white;
|
||||||
font-size: .4rem;
|
font-size: .4rem;
|
||||||
|
|||||||
@@ -0,0 +1,188 @@
|
|||||||
|
<template>
|
||||||
|
<div class="input-box">
|
||||||
|
<div class="input-content" @keydown="keydown" @keyup="keyup" @paste="paste" @mousewheel="mousewheel" @input="inputEvent">
|
||||||
|
<input max="9" min="0" maxlength="1" data-index="0" v-model.trim.number="input[0]" type="number" ref="firstinput"/>
|
||||||
|
<input max="9" min="0" maxlength="1" data-index="1" v-model.trim.number="input[1]" type="number"/>
|
||||||
|
<input max="9" min="0" maxlength="1" data-index="2" v-model.trim.number="input[2]" type="number"/>
|
||||||
|
<input max="9" min="0" maxlength="1" data-index="3" v-model.trim.number="input[3]" type="number"/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
.input-box {
|
||||||
|
.input-content {
|
||||||
|
height: 60px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-top: 1rem;
|
||||||
|
input {
|
||||||
|
color: inherit;
|
||||||
|
font-family: inherit;
|
||||||
|
border: 0;
|
||||||
|
outline: 0;
|
||||||
|
border-bottom: 2px solid $primary-color;
|
||||||
|
height: 60px;
|
||||||
|
width: 60px;
|
||||||
|
font-size: 1rem;
|
||||||
|
text-align: center;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
input::-webkit-outer-spin-button,
|
||||||
|
input::-webkit-inner-spin-button {
|
||||||
|
appearance: none;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
codeCount: 4,
|
||||||
|
eventObj: {},
|
||||||
|
pasteResult: [],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
props: ['code'],
|
||||||
|
computed: {
|
||||||
|
input() {
|
||||||
|
if (this.code && Array.isArray(this.code) && this.code.length === this.codeCount) {
|
||||||
|
return this.code;
|
||||||
|
} else if (/^\d{this.codeCount}$/.test(this.code.toString())) {
|
||||||
|
return this.code.toString().split('');
|
||||||
|
} else if (this.pasteResult.length === this.codeCount) {
|
||||||
|
return this.pasteResult;
|
||||||
|
} else {
|
||||||
|
return new Array(this.codeCount);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
is_weixn(){
|
||||||
|
const ua = navigator.userAgent.toLowerCase();
|
||||||
|
if(ua.match(/MicroMessenger/i)=="micromessenger") {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 解决一个输入框输入多个字符
|
||||||
|
inputEvent(e) {
|
||||||
|
var index = e.target.dataset.index * 1;
|
||||||
|
var el = e.target;
|
||||||
|
// el.value = el.value.replace(/Digit|Numpad/i, '').replace(/1/g, '').slice(0, 1);
|
||||||
|
this.$set(this.input, index, el.value)
|
||||||
|
},
|
||||||
|
keydown(e) {
|
||||||
|
var index = e.target.dataset.index * 1;
|
||||||
|
var el = e.target;
|
||||||
|
if (e.key === 'Backspace') {
|
||||||
|
if (this.input[index].length > 0) {
|
||||||
|
this.$set(this.input, index, '')
|
||||||
|
} else {
|
||||||
|
if (el.previousElementSibling) {
|
||||||
|
el.previousElementSibling.focus()
|
||||||
|
this.$set(this.input, index - 1, '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (e.key === 'Delete') {
|
||||||
|
if (this.input[index].length > 0) {
|
||||||
|
this.$set(this.input, index, '')
|
||||||
|
} else {
|
||||||
|
if (el.nextElementSibling) {
|
||||||
|
this.$set(this.input, index = 1, '')
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (el.nextElementSibling) {
|
||||||
|
el.nextElementSibling.focus()
|
||||||
|
}
|
||||||
|
} else if (e.key === 'Home') {
|
||||||
|
el.parentElement.children[0] && el.parentElement.children[0].focus()
|
||||||
|
} else if (e.key === 'End') {
|
||||||
|
el.parentElement.children[this.input.length - 1] && el.parentElement.children[this.input.length - 1].focus()
|
||||||
|
} else if (e.key === 'ArrowLeft') {
|
||||||
|
if (el.previousElementSibling) {
|
||||||
|
el.previousElementSibling.focus()
|
||||||
|
}
|
||||||
|
} else if (e.key === 'ArrowRight') {
|
||||||
|
if (el.nextElementSibling) {
|
||||||
|
el.nextElementSibling.focus()
|
||||||
|
}
|
||||||
|
} else if (e.key === 'ArrowUp') {
|
||||||
|
if (this.input[index] * 1 < 9) {
|
||||||
|
this.$set(this.input, index, (this.input[index] * 1 + 1).toString());
|
||||||
|
}
|
||||||
|
} else if (e.key === 'ArrowDown') {
|
||||||
|
if (this.input[index] * 1 > 0) {
|
||||||
|
this.$set(this.input, index, (this.input[index] * 1 - 1).toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
keyup(e) {
|
||||||
|
var index = e.target.dataset.index * 1;
|
||||||
|
var el = e.target;
|
||||||
|
// 解决输入e的问题
|
||||||
|
var reg = /Digit|Numpad/i;
|
||||||
|
this.eventObj = JSON.stringify(e);
|
||||||
|
el.value = el.value.replace(reg, '').slice(0, 1);
|
||||||
|
if (reg.test(e) || this.is_weixn) {
|
||||||
|
// 必须在这里符直,否则输入框会是空值
|
||||||
|
this.$set(this.input, index, el.value);
|
||||||
|
el.nextElementSibling && el.nextElementSibling.focus();
|
||||||
|
if (index === this.codeCount-1) {
|
||||||
|
if (this.input.join('').length === this.codeCount) {
|
||||||
|
document.activeElement.blur();
|
||||||
|
this.$emit('complete', this.input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (this.input[index] === '') {
|
||||||
|
this.$set(this.input, index, '');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mousewheel(e) {
|
||||||
|
var index = e.target.dataset.index;
|
||||||
|
if (e.wheelDelta > 0) {
|
||||||
|
if (this.input[index] * 1 < 9) {
|
||||||
|
this.$set(this.input, index, (this.input[index] * 1 + 1).toString());
|
||||||
|
}
|
||||||
|
} else if (e.wheelDelta < 0) {
|
||||||
|
if (this.input[index] * 1 > 0) {
|
||||||
|
this.$set(this.input, index, (this.input[index] * 1 - 1).toString());
|
||||||
|
}
|
||||||
|
} else if (e.key === 'Enter') {
|
||||||
|
if (this.input.join('').length === this.codeCount) {
|
||||||
|
document.activeElement.blur();
|
||||||
|
this.$emit('complete', this.input);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
paste(e) {
|
||||||
|
// 当进行粘贴时
|
||||||
|
e.clipboardData.items[0].getAsString(str => {
|
||||||
|
if (str.toString().length === this.codeCount) {
|
||||||
|
this.pasteResult = str.split('');
|
||||||
|
document.activeElement.blur();
|
||||||
|
this.$emit('complete', this.input);
|
||||||
|
this.pasteResult = [];
|
||||||
|
} else {
|
||||||
|
// 如果粘贴内容不合规,清除所有内容
|
||||||
|
this.input[0] = new Array(6)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
// 等待dom渲染完成,在执行focus,否则无法获取到焦点
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.firstinput.focus()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -69,12 +69,15 @@ export default {
|
|||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
/*金额滚动数字设置*/
|
/*金额滚动数字设置*/
|
||||||
.vue-number-scroll{
|
.vue-number-scroll{
|
||||||
|
margin-bottom: .5rem;
|
||||||
|
margin-top: .3rem;
|
||||||
.box-item {
|
.box-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
line-height: 40px;
|
line-height: 40px;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
padding: 2% 0;
|
padding: 2% 0;
|
||||||
|
height: 1.3rem;
|
||||||
position: relative;
|
position: relative;
|
||||||
list-style: none;
|
list-style: none;
|
||||||
text-orientation: upright;
|
text-orientation: upright;
|
||||||
|
|||||||
@@ -153,6 +153,9 @@ export default {
|
|||||||
font-size: .37rem;
|
font-size: .37rem;
|
||||||
letter-spacing: 1px;
|
letter-spacing: 1px;
|
||||||
}
|
}
|
||||||
|
& * {
|
||||||
|
max-width: 100% !important;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.purchase {
|
.purchase {
|
||||||
background: #cf9e3b;
|
background: #cf9e3b;
|
||||||
|
|||||||
@@ -69,7 +69,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<ul class="spec">
|
<ul class="spec">
|
||||||
<li class="random">
|
<li class="random">
|
||||||
<span class="border-circle" @click="showRandom = true">随喜</span>
|
<!-- <span class="border-circle" @click="showRandom = true">随喜</span>-->
|
||||||
|
<span class="border-circle" @click="onCustomeBrike">随喜</span>
|
||||||
</li>
|
</li>
|
||||||
<li v-for="(spec, index) in data.spec" :key="index">
|
<li v-for="(spec, index) in data.spec" :key="index">
|
||||||
<span class="border-circle" :class="[Number(spec.money) === priceUnit && 'active', isDisabled(spec)]" @click="onPriceUnit(spec)">{{spec.money}}元</span>
|
<span class="border-circle" :class="[Number(spec.money) === priceUnit && 'active', isDisabled(spec)]" @click="onPriceUnit(spec)">{{spec.money}}元</span>
|
||||||
@@ -86,7 +87,7 @@
|
|||||||
<div class="donate">
|
<div class="donate">
|
||||||
<span class="label">行善时间</span>
|
<span class="label">行善时间</span>
|
||||||
<span class="time-cycle">
|
<span class="time-cycle">
|
||||||
<van-stepper v-model="number" step="1" />
|
<van-stepper v-model="monthQuantity" step="1" />
|
||||||
<span class="unit">个月</span>
|
<span class="unit">个月</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -143,9 +144,10 @@
|
|||||||
</safe-area>
|
</safe-area>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</van-popup>
|
</van-popup>
|
||||||
<random-money :value.sync="showRandom"></random-money>
|
|
||||||
|
<!-- 随喜金额 -->
|
||||||
|
<random-money :value.sync="showRandom" @change="onRandomNext"></random-money>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -172,7 +174,6 @@ export default {
|
|||||||
for(let i in query){
|
for(let i in query){
|
||||||
query[i] = query[i].toString()
|
query[i] = query[i].toString()
|
||||||
}
|
}
|
||||||
console.log(query)
|
|
||||||
let onlySpecs = query.spec_ids ? query.spec_ids.split(',').map(v => Number(v)) : null;
|
let onlySpecs = query.spec_ids ? query.spec_ids.split(',').map(v => Number(v)) : null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -222,21 +223,29 @@ export default {
|
|||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
isDisabled(spec){
|
isDisabled(spec){
|
||||||
const { id } = spec;
|
const { id } = spec;
|
||||||
if(!this.onlySpecs) return false;
|
if(!this.onlySpecs) return false;
|
||||||
return !this.onlySpecs.includes(id) ? 'spec-disabled': ''
|
return !this.onlySpecs.includes(id) ? 'spec-disabled': ''
|
||||||
},
|
},
|
||||||
getSelectedSpec() {
|
getSelectedSpec() {
|
||||||
if(this.query.goods_type === '2'){
|
const { goods_type } = this.query;
|
||||||
|
if(goods_type === '2' || goods_type === '1'){
|
||||||
// 随喜
|
// 随喜
|
||||||
if(this.is_assign){
|
if(this.is_assign){
|
||||||
return {
|
return {
|
||||||
specId: '',
|
specId: '',
|
||||||
specName: this.data.rule_btn
|
specName: goods_type === '1' ? '随喜': this.data.rule_btn
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const spec = this.data.spec.find(item => item.id === this.priceUnitId);
|
const spec = this.data.spec.find(item => item.id === this.priceUnitId);
|
||||||
|
if(!spec){
|
||||||
|
return {
|
||||||
|
specId: '',
|
||||||
|
specName: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
specId: spec.id,
|
specId: spec.id,
|
||||||
specName: spec.spec_name,
|
specName: spec.spec_name,
|
||||||
@@ -258,12 +267,14 @@ export default {
|
|||||||
await this.getDynamicDataByGoodsId(goods_id);
|
await this.getDynamicDataByGoodsId(goods_id);
|
||||||
this.data = response;
|
this.data = response;
|
||||||
if(!this.onlySpecs){
|
if(!this.onlySpecs){
|
||||||
this.priceUnit = this.data.spec[0].donate_number * Number(this.data.price)
|
const { donate_number, money, id } = this.data.spec[0];
|
||||||
this.priceUnitId = this.data.spec[0].id;
|
const priceUnit = donate_number || money;
|
||||||
|
this.priceUnit = Number(priceUnit) * Number(this.data.price)
|
||||||
|
this.priceUnitId = id;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getDynamicDataByGoodsId(goods_id){
|
async getDynamicDataByGoodsId(goods_id){
|
||||||
const res = await getDynamicData(1, goods_id);
|
const res = await getDynamicData(1, 1, goods_id);
|
||||||
this.goodsDynamicList = res.results;
|
this.goodsDynamicList = res.results;
|
||||||
},
|
},
|
||||||
onMoreProcess() {
|
onMoreProcess() {
|
||||||
@@ -278,14 +289,19 @@ export default {
|
|||||||
},
|
},
|
||||||
// 设置行善单价
|
// 设置行善单价
|
||||||
onPriceUnit({id, money}){
|
onPriceUnit({id, money}){
|
||||||
|
this.is_assign = false;
|
||||||
this.priceUnit = Number(money);
|
this.priceUnit = Number(money);
|
||||||
this.priceUnitId = id;
|
this.priceUnitId = id;
|
||||||
this.buy_quantity = 1;
|
this.buy_quantity = 1;
|
||||||
if(this.query.goods_type === '2'){
|
this.spec_id = '';
|
||||||
this.is_assign = false;
|
},
|
||||||
}
|
onRandomNext({ money}){
|
||||||
|
this.anyPrice = money;
|
||||||
|
this.priceUnit = money;
|
||||||
|
this.onToPay();
|
||||||
},
|
},
|
||||||
onToPay(){
|
onToPay(){
|
||||||
|
// 不需要跳转到功德芳名
|
||||||
if(this.query.goods_type === '1'){
|
if(this.query.goods_type === '1'){
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'pay',
|
name: 'pay',
|
||||||
@@ -294,10 +310,12 @@ export default {
|
|||||||
is_auto: this.is_auto ? 1 : 0,
|
is_auto: this.is_auto ? 1 : 0,
|
||||||
spec_id: this.priceUnitId,
|
spec_id: this.priceUnitId,
|
||||||
friendly_time: this.monthQuantity,
|
friendly_time: this.monthQuantity,
|
||||||
title: this.title,
|
title: this.data.name,
|
||||||
subTitle: this.data.spec.find(item => item.id === this.priceUnitId).spec_name,
|
subTitle: '日行一善捐赠',
|
||||||
|
quantity: 1,
|
||||||
amount: this.priceTotal,
|
amount: this.priceTotal,
|
||||||
is_customized: 0,
|
is_customized: this.is_assign ? 1 : 0,
|
||||||
|
price: this.priceUnit,
|
||||||
from: 'friendly_day', // 标识为日行一善
|
from: 'friendly_day', // 标识为日行一善
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -315,7 +333,8 @@ export default {
|
|||||||
title: this.data.name,
|
title: this.data.name,
|
||||||
subTitle: this.getSelectedSpec().specName,
|
subTitle: this.getSelectedSpec().specName,
|
||||||
amount: this.priceTotal,
|
amount: this.priceTotal,
|
||||||
is_customized: 0,
|
is_customized: this.is_assign ? 1 : 0,
|
||||||
|
price: this.priceUnit,
|
||||||
buy_quantity: this.buy_quantity,
|
buy_quantity: this.buy_quantity,
|
||||||
from: 'brike', // 标识为填砖加瓦
|
from: 'brike', // 标识为填砖加瓦
|
||||||
}
|
}
|
||||||
@@ -327,8 +346,10 @@ export default {
|
|||||||
},
|
},
|
||||||
// 自定义砖数
|
// 自定义砖数
|
||||||
onCustomeBrike(){
|
onCustomeBrike(){
|
||||||
this.priceUnit = Number(this.data.price);
|
this.priceUnit = Number(this.data.price) || 0;
|
||||||
|
this.buy_quantity = 1;
|
||||||
this.is_assign = true;
|
this.is_assign = true;
|
||||||
|
this.showRandom = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ export default {
|
|||||||
this.showDesire = true;
|
this.showDesire = true;
|
||||||
},
|
},
|
||||||
onMeritName(meritNameArr){
|
onMeritName(meritNameArr){
|
||||||
console.log(meritNameArr)
|
|
||||||
this.merit_names = meritNameArr;
|
this.merit_names = meritNameArr;
|
||||||
},
|
},
|
||||||
onMeritDesire(desire){
|
onMeritDesire(desire){
|
||||||
@@ -86,6 +85,12 @@ export default {
|
|||||||
if(!this.mobile){
|
if(!this.mobile){
|
||||||
return this.$toast.fail('请填写功德主手机号');
|
return this.$toast.fail('请填写功德主手机号');
|
||||||
}
|
}
|
||||||
|
console.log('query', {
|
||||||
|
...this.$route.query,
|
||||||
|
dream: this.dream,
|
||||||
|
merit_name: this.meritName,
|
||||||
|
mobile: this.mobile,
|
||||||
|
})
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: 'pay',
|
name: 'pay',
|
||||||
query: {
|
query: {
|
||||||
@@ -104,6 +109,7 @@ export default {
|
|||||||
.fill-name{
|
.fill-name{
|
||||||
background: #f9f9f9;
|
background: #f9f9f9;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
position: relative;
|
||||||
.panel-wrapper{
|
.panel-wrapper{
|
||||||
padding: .3rem;
|
padding: .3rem;
|
||||||
}
|
}
|
||||||
@@ -159,7 +165,7 @@ export default {
|
|||||||
position: absolute;
|
position: absolute;
|
||||||
left: .3rem;
|
left: .3rem;
|
||||||
right: .3rem;
|
right: .3rem;
|
||||||
bottom: .5rem;
|
bottom: calc(.5rem + env(safe-area-inset-bottom));
|
||||||
border: 1px solid $primary-color;
|
border: 1px solid $primary-color;
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
background: white;
|
background: white;
|
||||||
|
|||||||
@@ -1,47 +1,94 @@
|
|||||||
<template>
|
<template>
|
||||||
<van-form @submit="onSubmit">
|
<!-- <van-form @submit="onSubmit">-->
|
||||||
<van-field
|
<!-- <van-field-->
|
||||||
v-model="mobile"
|
<!-- v-model="mobile"-->
|
||||||
name="手机号码"
|
<!-- name="手机号码"-->
|
||||||
label="手机号"
|
<!-- label="手机号"-->
|
||||||
type="tel"
|
<!-- type="tel"-->
|
||||||
placeholder="请输入手机号"
|
<!-- placeholder="请输入手机号"-->
|
||||||
:rules="[{ required: true, message: '请输入手机号' }]"
|
<!-- :rules="[{ required: true, message: '请输入手机号' }]"-->
|
||||||
>
|
<!-- >-->
|
||||||
<template #extra>
|
<!-- <template #extra>-->
|
||||||
<van-button v-if="countdown === 0" type="primary" size="mini" native-type="button" @click.stop.prevent="onSendCode">发送验证码</van-button>
|
<!-- <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>
|
<!-- <van-button v-else size="mini">{{countdown}}秒后重发</van-button>-->
|
||||||
</template>
|
<!-- </template>-->
|
||||||
</van-field>
|
<!-- </van-field>-->
|
||||||
<van-field
|
<!-- <van-field-->
|
||||||
v-model="validCode"
|
<!-- v-model="validCode"-->
|
||||||
type="tel"
|
<!-- type="tel"-->
|
||||||
name="验证码"
|
<!-- name="验证码"-->
|
||||||
label="验证码"
|
<!-- label="验证码"-->
|
||||||
placeholder="验证码"
|
<!-- placeholder="验证码"-->
|
||||||
:rules="[{ required: true, message: '请填写密码' }]"
|
<!-- :rules="[{ required: true, message: '请填写密码' }]"-->
|
||||||
/>
|
<!-- />-->
|
||||||
<div style="margin: 16px;">
|
<!-- <div style="margin: 16px;">-->
|
||||||
<van-button round block type="info" native-type="submit">提交</van-button>
|
<!-- <van-button round block type="info" native-type="submit">提交</van-button>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- </van-form>-->
|
||||||
|
<div style="height: 100%">
|
||||||
|
<div class="top" v-if="!sended">
|
||||||
|
<h1 class="title">阿弥陀佛,</h1>
|
||||||
|
<h1 class="title">欢迎来到自在福田</h1>
|
||||||
|
<div class="inner">
|
||||||
|
<div class="field">
|
||||||
|
<input type="tel" v-model="mobile" maxlength="11" placeholder="请输入手机号码">
|
||||||
|
</div>
|
||||||
|
<p class="tip">未注册的手机号验证后自动创建账户</p>
|
||||||
|
|
||||||
|
<van-button class="btn" type="info" :disabled="validMobile" block @click="onSendCode">获取短信验证码</van-button>
|
||||||
|
<p class="desc">自在福田,广种福田,护持寺院,功德无量</p>
|
||||||
|
|
||||||
|
<p class="agree">登录即表明同意<a @click="onAgreement(1)">《自在福田用户协议》</a>和<a @click="onAgreement(1)">《隐私政策》</a></p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="top" v-if="sended">
|
||||||
|
<h1 class="title">请输入验证码</h1>
|
||||||
|
<p class="send-to">验证码已发送至 {{mobile | fmMobile}}</p>
|
||||||
|
<sms-code-input :code="validCode" @complete="onSubmitBefore"></sms-code-input>
|
||||||
|
<p class="resend"><span>{{countdown}}</span>秒后重新发送验证码</p>
|
||||||
|
<van-button type="info" :disabled="!(validCode.length === 4)" block @click="onSubmit">提交</van-button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</van-form>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getMobileValidateCode, postMobileCode } from '@/api';
|
import { getMobileValidateCode, postMobileCode } from '@/api';
|
||||||
|
import SmsCodeInput from '@/components/sms-code-input'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {
|
||||||
|
SmsCodeInput
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
mobile: '',
|
mobile: '',
|
||||||
validCode: '',
|
validCode: '',
|
||||||
countdown: 0,
|
countdown: 0,
|
||||||
timer: null,
|
timer: null,
|
||||||
|
sended: false,
|
||||||
|
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
filters: {
|
||||||
|
fmMobile(val){
|
||||||
|
return val.replace(/(\d{3})(\d{4})/, "$1 $2 ")
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
validMobile(){
|
||||||
|
const reg = /^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])\d{8}$/;
|
||||||
|
return !reg.test(this.mobile)
|
||||||
|
},
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
async onSubmit(values) {
|
onAgreement(agreeId){
|
||||||
console.log('submit', values);
|
this.$router.push({ name: 'user-temple-station-agreement', query: { agreeId }})
|
||||||
|
},
|
||||||
|
onSubmitBefore(code){
|
||||||
|
this.validCode = code
|
||||||
|
this.onSubmit();
|
||||||
|
},
|
||||||
|
async onSubmit() {
|
||||||
const { mobile, validCode } = this;
|
const { mobile, validCode } = this;
|
||||||
if(!mobile){
|
if(!mobile){
|
||||||
return this.$toast('请输入手机号')
|
return this.$toast('请输入手机号')
|
||||||
@@ -49,12 +96,13 @@ export default {
|
|||||||
if(!validCode){
|
if(!validCode){
|
||||||
return this.$toast('请输入验证码')
|
return this.$toast('请输入验证码')
|
||||||
}
|
}
|
||||||
const res = await postMobileCode(mobile, validCode)
|
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.$router.back();
|
||||||
this.$bus.$emit('updateMobile')
|
this.$bus.$emit('updateMobile')
|
||||||
|
this.$router.replace({ name: 'user-home'})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onSendCode(){
|
onSendCode(){
|
||||||
@@ -66,6 +114,7 @@ export default {
|
|||||||
getMobileValidateCode(mobile).then(success => {
|
getMobileValidateCode(mobile).then(success => {
|
||||||
if(success){
|
if(success){
|
||||||
this.$toast('发送成功,请注意查收短信');
|
this.$toast('发送成功,请注意查收短信');
|
||||||
|
this.sended = true;
|
||||||
if(this.countdown === 0){
|
if(this.countdown === 0){
|
||||||
this.countdown = 60;
|
this.countdown = 60;
|
||||||
this.countdownSecond()
|
this.countdownSecond()
|
||||||
@@ -86,6 +135,65 @@ export default {
|
|||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style lang="scss" scoped>
|
||||||
|
.top{
|
||||||
|
padding: 0 .5rem;
|
||||||
|
padding-top: 2rem;
|
||||||
|
font-size: .35rem;
|
||||||
|
.title{
|
||||||
|
font-size: .6rem;
|
||||||
|
margin-top: .3rem;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.inner{
|
||||||
|
margin-top: 2rem;
|
||||||
|
.field{
|
||||||
|
background: #f1f1f1;
|
||||||
|
margin-bottom: .2rem;
|
||||||
|
padding: .1rem .4rem;
|
||||||
|
input{
|
||||||
|
height: .8rem;
|
||||||
|
background: transparent;
|
||||||
|
border: none;
|
||||||
|
display: block;
|
||||||
|
width: 100%;
|
||||||
|
font-size: .4rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.tip{
|
||||||
|
font-size: .3rem;
|
||||||
|
margin-bottom: 1.2rem;
|
||||||
|
color: #888;
|
||||||
|
}
|
||||||
|
|
||||||
|
.desc{
|
||||||
|
font-size: .4rem;
|
||||||
|
text-align: center;
|
||||||
|
padding-top: 2rem;
|
||||||
|
}
|
||||||
|
.agree{
|
||||||
|
font-size: .35rem;
|
||||||
|
text-align: center;
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 2rem;
|
||||||
|
a{
|
||||||
|
color: $primary-color;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.send-to{
|
||||||
|
font-size: .35rem;
|
||||||
|
margin-top: .2rem;
|
||||||
|
}
|
||||||
|
.resend{
|
||||||
|
padding-top: .6rem;
|
||||||
|
margin-bottom: 3rem;
|
||||||
|
span{
|
||||||
|
color: $primary-color;
|
||||||
|
padding-right: .2rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -96,7 +96,48 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
locationTo(nav) {
|
locationTo(nav) {
|
||||||
|
// nav.type: 0外部链接,1日行一善商品,2添砖加瓦类商品,3通用商品,4功德箱,5进展动态
|
||||||
|
if(nav.type === 0){
|
||||||
window.location.href = nav.url;
|
window.location.href = nav.url;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nav.type === 5){
|
||||||
|
this.$router.push({
|
||||||
|
name: 'buddha-detail',
|
||||||
|
query: { id: nav.dynamic_id }
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nav.type === 4){
|
||||||
|
this.$router.push({
|
||||||
|
name: 'merit-box'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nav.type === 3){
|
||||||
|
this.$router.push({
|
||||||
|
name: 'goods-detail',
|
||||||
|
query: {
|
||||||
|
goods_type: nav.type,
|
||||||
|
goods_id: nav.goods_id ,
|
||||||
|
temple_id: nav.temple_id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nav.type === 1 || nav.type === 2){
|
||||||
|
this.$router.push({
|
||||||
|
name: 'everyday-donation',
|
||||||
|
query: {
|
||||||
|
goods_type: nav.type,
|
||||||
|
goods_id: nav.goods_id ,
|
||||||
|
temple_id: nav.temple_id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async getTempleIndex() {
|
async getTempleIndex() {
|
||||||
const res = await getTempleIndex(this.query.temple_id);
|
const res = await getTempleIndex(this.query.temple_id);
|
||||||
|
|||||||
@@ -58,26 +58,20 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|
||||||
onContinuePayOrder(){
|
onContinuePayOrder(){
|
||||||
this.onPayment({ id: this.query.order_id })
|
this.onPayment({ id: this.query.order_id })
|
||||||
},
|
},
|
||||||
async onCreatePayOrder(){
|
async onCreatePayOrder(){
|
||||||
// 创建日行一善支付订单
|
// 创建日行一善支付订单
|
||||||
if(this.query.goods_type == '1'){
|
if(this.query.goods_type == '1'){
|
||||||
const request = {
|
const request = { ...this.query }
|
||||||
...this.query,
|
|
||||||
}
|
|
||||||
const order = await createFriendlyDayOrder(request)
|
const order = await createFriendlyDayOrder(request)
|
||||||
this.onPayment(order)
|
this.onPayment(order)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
// 创建填砖加瓦订单
|
// 创建填砖加瓦订单
|
||||||
if(this.query.goods_type == '2'){
|
if(this.query.goods_type == '2'){
|
||||||
const request = {
|
const request = { ...this.query }
|
||||||
...this.query,
|
|
||||||
|
|
||||||
}
|
|
||||||
const order = await createBrickDayOrder(request)
|
const order = await createBrickDayOrder(request)
|
||||||
await this.onPayment(order)
|
await this.onPayment(order)
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -9,11 +9,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="certed-temple" @click="$router.push({name: 'temple-detail', query: { temple_id: query.temple_id}})">
|
<div class="certed-temple" @click="$router.push({name: 'temple-detail', query: { temple_id: query.temple_id}})">
|
||||||
<img class="cert-icon" src="@/assets/img/cert.jpg" alt="">
|
<img class="cert-icon" src="@/assets/img/cert.jpg" alt="">
|
||||||
<span class="text">佛教协会认证寺院 可放心访问</span>
|
<span class="text">认证寺院可放心访问</span>
|
||||||
<span class="btn">查看</span>
|
<span class="btn">查看</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="swiper">
|
<div class="swiper" v-if="data.banner_data.length > 0">
|
||||||
<van-swipe class="my-swipe" :autoplay="8000" indicator-color="white">
|
<van-swipe class="my-swipe" :autoplay="8000" indicator-color="white">
|
||||||
<van-swipe-item v-for="(banner, index) in data.banner_data" :key="index">
|
<van-swipe-item v-for="(banner, index) in data.banner_data" :key="index">
|
||||||
<img :src="banner.cover" alt="" @click="$router.push({ path: banner.url})">
|
<img :src="banner.cover" alt="" @click="$router.push({ path: banner.url})">
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
<van-swipe class="grid-nav" :loop="false">
|
<van-swipe class="grid-nav" :loop="false">
|
||||||
<van-swipe-item v-for="(item, index) in data.icon_data" :key="index">
|
<van-swipe-item v-for="(item, index) in data.icon_data" :key="index">
|
||||||
<van-grid :border="false">
|
<van-grid :border="false">
|
||||||
<van-grid-item icon="photo-o" :text="nav.name" v-for="(nav, _index) in item" :key="_index">
|
<van-grid-item icon="photo-o" :text="nav.name" v-for="(nav, _index) in item" :key="_index" @click="locationTo(nav)">
|
||||||
<img :src="nav.icon_url" class="nav-icon" slot="icon">
|
<img :src="nav.icon_url" class="nav-icon" slot="icon">
|
||||||
</van-grid-item>
|
</van-grid-item>
|
||||||
</van-grid>
|
</van-grid>
|
||||||
@@ -143,6 +143,50 @@ export default {
|
|||||||
this.getUserData();
|
this.getUserData();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
locationTo(nav) {
|
||||||
|
// nav.type: 0外部链接,1日行一善商品,2添砖加瓦类商品,3通用商品,4功德箱,5进展动态
|
||||||
|
if(nav.type === 0){
|
||||||
|
window.location.href = nav.url;
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nav.type === 5){
|
||||||
|
this.$router.push({
|
||||||
|
name: 'buddha-detail',
|
||||||
|
query: { id: nav.dynamic_id }
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nav.type === 4){
|
||||||
|
this.$router.push({
|
||||||
|
name: 'merit-box'
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nav.type === 3){
|
||||||
|
this.$router.push({
|
||||||
|
name: 'goods-detail',
|
||||||
|
query: {
|
||||||
|
goods_type: nav.type,
|
||||||
|
goods_id: nav.goods_id ,
|
||||||
|
temple_id: nav.temple_id,
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if(nav.type === 1 || nav.type === 2){
|
||||||
|
this.$router.push({
|
||||||
|
name: 'everyday-donation',
|
||||||
|
query: {
|
||||||
|
goods_type: nav.type,
|
||||||
|
goods_id: nav.goods_id ,
|
||||||
|
temple_id: nav.temple_id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
onPushForRouteName(routeName){
|
onPushForRouteName(routeName){
|
||||||
this.$router.push({ name: routeName })
|
this.$router.push({ name: routeName })
|
||||||
},
|
},
|
||||||
@@ -217,7 +261,7 @@ export default {
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
.user-dynamic-container {
|
.user-dynamic-container {
|
||||||
margin-top: 0.5rem;
|
margin-top: 0.3rem;
|
||||||
height: 1.26rem;
|
height: 1.26rem;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
.van-swipe {
|
.van-swipe {
|
||||||
@@ -360,7 +404,7 @@ export default {
|
|||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
-webkit-line-clamp: 3;
|
-webkit-line-clamp: 3;
|
||||||
text-align: justify;
|
text-align: justify;
|
||||||
height: 4.3em;
|
max-height: 4.3em;
|
||||||
-webkit-box-orient: vertical;
|
-webkit-box-orient: vertical;
|
||||||
color: #999;
|
color: #999;
|
||||||
}
|
}
|
||||||
@@ -402,8 +446,6 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.grid-nav {
|
.grid-nav {
|
||||||
margin-bottom: .8rem;
|
|
||||||
|
|
||||||
.nav-icon {
|
.nav-icon {
|
||||||
width: 1.07rem;
|
width: 1.07rem;
|
||||||
height: 1.07rem;
|
height: 1.07rem;
|
||||||
|
|||||||
@@ -32,16 +32,16 @@
|
|||||||
<span @click.stop="onAgreement">同意自在福田服务协议</span>
|
<span @click.stop="onAgreement">同意自在福田服务协议</span>
|
||||||
</van-checkbox>
|
</van-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<van-button type="warning" :disabled="!canNextStep2" block @click="onNextStep">下一步</van-button>
|
<van-button type="warning" :disabled="!canNextStep2" block @click="onNextStep(1)">下一步</van-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="form" v-if="step === 2">
|
<div class="form" v-if="step === 2">
|
||||||
<van-form>
|
<van-form>
|
||||||
<div class="group">
|
<div class="group">
|
||||||
<label class="label-temple" for="#">寺院信息设置</label>
|
<label class="label-temple" for="#">寺院信息设置</label>
|
||||||
<van-field label="单位名称" v-model="form.unit_name" name="单位名称" placeholder="单位名称" />
|
<van-field label="单位名称" v-model="form.unit_name" name="单位名称" placeholder="单位名称" />
|
||||||
<van-field label="机构代码" v-model="form.institution_code" name="机构代码" placeholder="机构代码、信用代码(18位)" />
|
<van-field label="机构代码" v-model="form.institution_code" name="机构代码" maxlength="18" placeholder="机构代码、信用代码(18位)" />
|
||||||
<van-field label="省份城市" v-model="form.city_name" name="省份城市" is-link readonly placeholder="省份城市" @click="showProvince = true" />
|
<van-field label="省份城市" v-model="form.city_name" name="省份城市" is-link readonly placeholder="省份城市" @click="showProvince = true" />
|
||||||
<van-field label="详细地址" v-model="form.details_address" name="详细地址" placeholder="请输入详细地址" >
|
<van-field label="详细地址" v-model="form.details_address" name="详细地址" placeholder="请输入详细地址" @blur="onUpdateLatLng">
|
||||||
<template #right-icon>
|
<template #right-icon>
|
||||||
<van-button type="info" size="small" @click="onGetAddress">自动获取</van-button>
|
<van-button type="info" size="small" @click="onGetAddress">自动获取</van-button>
|
||||||
</template>
|
</template>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
<span class="label">您是寺院法人?</span>
|
<span class="label">您是寺院法人?</span>
|
||||||
<van-checkbox v-model="form.is_representd" shape="aquare"></van-checkbox>
|
<van-checkbox v-model="form.is_representd" shape="aquare"></van-checkbox>
|
||||||
</div>
|
</div>
|
||||||
<van-field v-if="!form.is_representd" label="注册人" placeholder="请输入真实姓名"></van-field>
|
<van-field v-if="!form.is_representd" v-model="form.register_name" label="注册人" placeholder="请输入真实姓名"></van-field>
|
||||||
<van-field label="手机号码" v-model="form.login_mobile" placeholder="请输入手机号码" type="tel" />
|
<van-field label="手机号码" v-model="form.login_mobile" placeholder="请输入手机号码" type="tel" />
|
||||||
<van-field label="登录密码" v-model="form.password" placeholder="请输入至少6位数字、字母和符号组合" type="password"></van-field>
|
<van-field label="登录密码" v-model="form.password" placeholder="请输入至少6位数字、字母和符号组合" type="password"></van-field>
|
||||||
<van-field label="确认密码" v-model="form.password_confirm" placeholder="请确认密码" type="password"></van-field>
|
<van-field label="确认密码" v-model="form.password_confirm" placeholder="请确认密码" type="password"></van-field>
|
||||||
@@ -73,9 +73,14 @@
|
|||||||
<p class="label">平台入驻管理员微信</p>
|
<p class="label">平台入驻管理员微信</p>
|
||||||
<p class="notice">审核通过后将微信通知入驻上架具体事宜</p>
|
<p class="notice">审核通过后将微信通知入驻上架具体事宜</p>
|
||||||
<div class="button-group">
|
<div class="button-group">
|
||||||
|
<van-button type="default" block class="prev" @click="onNextStep(-1)">上一步</van-button>
|
||||||
<van-button type="warning" block class="confirm" @click="onSubmit">提交</van-button>
|
<van-button type="warning" block class="confirm" @click="onSubmit">提交</van-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="loading" v-if="loading">
|
||||||
|
<div class="loading-mask" @touchmove.stop.prevent></div>
|
||||||
|
<van-loading size="50px"></van-loading>
|
||||||
|
</div>
|
||||||
|
|
||||||
<van-popup v-model="showProvince" round position="bottom" safe-area-inset-bottom>
|
<van-popup v-model="showProvince" round position="bottom" safe-area-inset-bottom>
|
||||||
<van-cascader
|
<van-cascader
|
||||||
@@ -91,13 +96,14 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { getRegion, postTemple } from '@/api'
|
import { getRegion, getStationTemplate, postTemple } from '@/api';
|
||||||
import { getLocation } from '@/common/wechat-web';
|
import { getLocation } from '@/common/wechat-web';
|
||||||
import TMAPLoader from '@/common/tmap';
|
import TMAPLoader from '@/common/tmap';
|
||||||
import Schema from 'async-validator';
|
import Schema from 'async-validator';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
data(){
|
data(){
|
||||||
|
// eslint-disable-next-line no-unused-vars
|
||||||
const testForm = {
|
const testForm = {
|
||||||
// register_cert_url: [{url: 'https://caiyuehui.oss-cn-hangzhou.aliyuncs.com/uploads/dev/2021/11/04/phpjXpokW.jpeg'}],
|
// register_cert_url: [{url: 'https://caiyuehui.oss-cn-hangzhou.aliyuncs.com/uploads/dev/2021/11/04/phpjXpokW.jpeg'}],
|
||||||
register_cert_url: [],
|
register_cert_url: [],
|
||||||
@@ -118,8 +124,8 @@ export default {
|
|||||||
password: '123456', // 登录密码
|
password: '123456', // 登录密码
|
||||||
password_confirm: '123456', // 确认密码
|
password_confirm: '123456', // 确认密码
|
||||||
}
|
}
|
||||||
console.log(testForm)
|
|
||||||
return {
|
return {
|
||||||
|
loading: false,
|
||||||
query: this.$route.query,
|
query: this.$route.query,
|
||||||
active: 0,
|
active: 0,
|
||||||
agreement: true, // 是否同意寺院联盟服务协议
|
agreement: true, // 是否同意寺院联盟服务协议
|
||||||
@@ -167,7 +173,8 @@ export default {
|
|||||||
},
|
},
|
||||||
// form: testForm,
|
// form: testForm,
|
||||||
geocoder: null,
|
geocoder: null,
|
||||||
TMap: null
|
TMap: null,
|
||||||
|
selectedOptions: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -194,11 +201,28 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
|
if(this.$route.query.template_id){
|
||||||
|
return this.getStationTemplate()
|
||||||
|
}
|
||||||
if(this.form.register_cert_url.length === 0 && Number(this.$route.query.step) !== 1){
|
if(this.form.register_cert_url.length === 0 && Number(this.$route.query.step) !== 1){
|
||||||
return this.$router.push({ query: { step: 1 }});
|
return this.$router.push({ query: { step: 1 }});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
async getStationTemplate(){
|
||||||
|
this.loading = true;
|
||||||
|
const data = await getStationTemplate(this.$route.query.template_id);
|
||||||
|
this.loading = false;
|
||||||
|
data.register_cert_url = data.register_cert_url.split(',').map(item => ({ url: item }));
|
||||||
|
data.is_representd = data.is_representd === 1;
|
||||||
|
this.form = { ...this.form, ...data }
|
||||||
|
const selectedOptions = [];
|
||||||
|
const province = this.cityOptions.find(item => item.value === data.province_id);
|
||||||
|
selectedOptions.push(province);
|
||||||
|
const city = province.children.find(item => item.value === data.city_id);
|
||||||
|
selectedOptions.push(city)
|
||||||
|
this.onFinishProvince({ selectedOptions })
|
||||||
|
},
|
||||||
onAgreement(){
|
onAgreement(){
|
||||||
this.$router.push({ name: 'user-temple-station-agreement' })
|
this.$router.push({ name: 'user-temple-station-agreement' })
|
||||||
},
|
},
|
||||||
@@ -210,20 +234,41 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onNextStep(){
|
onNextStep(step = 1){
|
||||||
this.$router.push({ query: { step: this.step + 1 }})
|
this.$router.push({ query: { step: this.step + step }})
|
||||||
},
|
},
|
||||||
onGetAddress(){
|
onGetAddress(){
|
||||||
getLocation().then(({ longitude, latitude}) => {
|
getLocation().then(({ longitude, latitude}) => {
|
||||||
const location = new this.TMap.LatLng(latitude, longitude)
|
const location = new this.TMap.LatLng(latitude, longitude)
|
||||||
this.geocoder.getAddress({ location }).then(res => {
|
this.geocoder.getAddress({ location }).then(res => {
|
||||||
console.log('geocoder:', res)
|
|
||||||
this.form.details_address = res.result.address
|
this.form.details_address = res.result.address
|
||||||
this.form.lng = longitude
|
this.form.lng = longitude
|
||||||
this.form.lat = latitude
|
this.form.lat = latitude
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
async getLatLngByAddress(addressText){
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
this.loading = true;
|
||||||
|
const cityAddress = this.selectedOptions.map(v => v.text).join('')
|
||||||
|
this.geocoder.getLocation({address: cityAddress + addressText}).then(res => {
|
||||||
|
this.loading = false
|
||||||
|
resolve(res.result.location)
|
||||||
|
}).catch(error => {
|
||||||
|
this.loading = false;
|
||||||
|
if(error.status === 347){
|
||||||
|
this.$toast.fail('未查询到地址信息,请核对地址')
|
||||||
|
reject();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 根据地址更新坐标
|
||||||
|
async onUpdateLatLng({ target: { value }}){
|
||||||
|
const { lat, lng } = await this.getLatLngByAddress(value)
|
||||||
|
this.form.lat = lat;
|
||||||
|
this.form.lng = lng;
|
||||||
|
},
|
||||||
getParams(){
|
getParams(){
|
||||||
getRegion().then(city => {
|
getRegion().then(city => {
|
||||||
this.cityOptions = city
|
this.cityOptions = city
|
||||||
@@ -239,7 +284,7 @@ export default {
|
|||||||
return this.handleErrors(errors)
|
return this.handleErrors(errors)
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
this.onNextStep();
|
this.onNextStep(1);
|
||||||
}))
|
}))
|
||||||
},
|
},
|
||||||
async onSubmit(){
|
async onSubmit(){
|
||||||
@@ -256,6 +301,7 @@ export default {
|
|||||||
this.$router.replace({ name: 'user-home'})
|
this.$router.replace({ name: 'user-home'})
|
||||||
},
|
},
|
||||||
onFinishProvince({selectedOptions}){
|
onFinishProvince({selectedOptions}){
|
||||||
|
this.selectedOptions = selectedOptions;
|
||||||
this.showProvince = false;
|
this.showProvince = false;
|
||||||
this.form.city_name = selectedOptions.map(v => v.text).join(' / ')
|
this.form.city_name = selectedOptions.map(v => v.text).join(' / ')
|
||||||
this.form.city_id = selectedOptions.map(v => v.value)
|
this.form.city_id = selectedOptions.map(v => v.value)
|
||||||
@@ -342,6 +388,27 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
.loading{
|
||||||
|
position: fixed;
|
||||||
|
left: 0;top:0;right: 0;bottom: 0;
|
||||||
|
width: 3rem;
|
||||||
|
height: 3rem;
|
||||||
|
background: rgba(0,0,0,0.6);
|
||||||
|
margin: auto;
|
||||||
|
border-radius: .3rem;
|
||||||
|
font-size: .3rem;
|
||||||
|
color: white;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
.loading-mask{
|
||||||
|
position: fixed;
|
||||||
|
left: 0;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
.form{
|
.form{
|
||||||
padding: .4rem 0;
|
padding: .4rem 0;
|
||||||
.group{
|
.group{
|
||||||
@@ -398,6 +465,11 @@ export default {
|
|||||||
}
|
}
|
||||||
.button-group{
|
.button-group{
|
||||||
margin-top: 2rem;
|
margin-top: 2rem;
|
||||||
|
display: flex;
|
||||||
|
.prev{
|
||||||
|
margin-right: .3rem;
|
||||||
|
width: 3rem;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.button-group{
|
.button-group{
|
||||||
|
|||||||
+12
-12
@@ -23,19 +23,19 @@ module.exports = {
|
|||||||
}).end();
|
}).end();
|
||||||
})
|
})
|
||||||
|
|
||||||
config.plugin('compression').use(
|
// config.plugin('compression').use(
|
||||||
new CompressionWebpackPlugin({
|
// new CompressionWebpackPlugin({
|
||||||
filename: info => `${info.path}.gz${info.query}`,
|
// filename: info => `${info.path}.gz${info.query}`,
|
||||||
algorithm: 'gzip',
|
// algorithm: 'gzip',
|
||||||
threshold: 10240,
|
// threshold: 10240,
|
||||||
test: /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i,
|
// test: /\.(js|css|json|txt|html|ico|svg)(\?.*)?$/i,
|
||||||
minRatio: 0.8,
|
// minRatio: 0.8,
|
||||||
deleteOriginalAssets: true
|
// deleteOriginalAssets: true
|
||||||
})
|
// })
|
||||||
)
|
// )
|
||||||
|
|
||||||
config.resolve.plugins.delete('prefetch');
|
// config.resolve.plugins.delete('prefetch');
|
||||||
config.resolve.plugins.delete('prerload');
|
// config.resolve.plugins.delete('prerload');
|
||||||
|
|
||||||
},
|
},
|
||||||
configureWebpack: config => {
|
configureWebpack: config => {
|
||||||
|
|||||||
+1
-1
File diff suppressed because one or more lines are too long
@@ -8667,6 +8667,11 @@ vue@^2.6.11:
|
|||||||
resolved "https://registry.npmmirror.com/vue/download/vue-2.6.14.tgz?cache=0&sync_timestamp=1633712790340&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fvue%2Fdownload%2Fvue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235"
|
resolved "https://registry.npmmirror.com/vue/download/vue-2.6.14.tgz?cache=0&sync_timestamp=1633712790340&other_urls=https%3A%2F%2Fregistry.npmmirror.com%2Fvue%2Fdownload%2Fvue-2.6.14.tgz#e51aa5250250d569a3fbad3a8a5a687d6036e235"
|
||||||
integrity sha1-5RqlJQJQ1Wmj+606ilpofWA24jU=
|
integrity sha1-5RqlJQJQ1Wmj+606ilpofWA24jU=
|
||||||
|
|
||||||
|
vuex@^3.6.2:
|
||||||
|
version "3.6.2"
|
||||||
|
resolved "https://registry.nlark.com/vuex/download/vuex-3.6.2.tgz#236bc086a870c3ae79946f107f16de59d5895e71"
|
||||||
|
integrity sha1-I2vAhqhww655lG8QfxbeWdWJXnE=
|
||||||
|
|
||||||
watchpack-chokidar2@^2.0.1:
|
watchpack-chokidar2@^2.0.1:
|
||||||
version "2.0.1"
|
version "2.0.1"
|
||||||
resolved "https://registry.nlark.com/watchpack-chokidar2/download/watchpack-chokidar2-2.0.1.tgz#38500072ee6ece66f3769936950ea1771be1c957"
|
resolved "https://registry.nlark.com/watchpack-chokidar2/download/watchpack-chokidar2-2.0.1.tgz#38500072ee6ece66f3769936950ea1771be1c957"
|
||||||
|
|||||||
Reference in New Issue
Block a user