123
This commit is contained in:
@@ -45,10 +45,7 @@
|
||||
</ul>
|
||||
</div>
|
||||
<div>
|
||||
<user-merit></user-merit>
|
||||
<user-merit></user-merit>
|
||||
<user-merit></user-merit>
|
||||
<user-merit></user-merit>
|
||||
<!-- <user-merit v-for=""></user-merit> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="merit-button-group border-top">
|
||||
@@ -63,7 +60,7 @@
|
||||
</div>
|
||||
<ul class="spec">
|
||||
<li class="random">
|
||||
<span class="border-circle">随喜</span>
|
||||
<span class="border-circle" @click="showRandom = true">随喜</span>
|
||||
</li>
|
||||
<li v-for="(spec, index) in data.spec" :key="index">
|
||||
<span class="border-circle" :class="[Number(spec.money) === priceUnit && 'active']" @click="onPriceUnit(spec)">{{spec.money}}元</span>
|
||||
@@ -132,6 +129,7 @@
|
||||
</div>
|
||||
|
||||
</van-popup>
|
||||
<random-money :value.sync="showRandom"></random-money>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -142,25 +140,31 @@ import { getGoodsDetail } from '@/api'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
swiper, swiperSlide
|
||||
},
|
||||
swiper,
|
||||
swiperSlide,
|
||||
},
|
||||
data(){
|
||||
const { query } = this.$route;
|
||||
let title = '详情';
|
||||
if(query.goods_type === '-1'){
|
||||
if(query.goods_type === '1'){
|
||||
title = '日行一善';
|
||||
}
|
||||
if(query.goods_type === '-2'){
|
||||
if(query.goods_type === '2'){
|
||||
title = '添砖加瓦'
|
||||
}
|
||||
document.title = title;
|
||||
console.log( JSON.stringify(query))
|
||||
for(let i in query){
|
||||
query[i] = query[i].toString()
|
||||
}
|
||||
return {
|
||||
showRandom: false, // 随喜
|
||||
documentTitle: title,
|
||||
query,
|
||||
data: null,
|
||||
value: 1,
|
||||
is_auto: false, // 是否自动行善
|
||||
showSpec: true,
|
||||
showSpec: false,
|
||||
priceUnit: 0,
|
||||
priceUnitId: '',
|
||||
number: 1,
|
||||
@@ -184,10 +188,11 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted(){
|
||||
if(this.query.goods_type === '-1'){
|
||||
console.log('query', this.query)
|
||||
if(this.query.goods_type === '1'){
|
||||
return this.getGoodsDetail('friendly');
|
||||
}
|
||||
if(this.query.goods_type === '-2'){
|
||||
if(this.query.goods_type === '2'){
|
||||
return this.getGoodsDetail('tile');
|
||||
}
|
||||
|
||||
@@ -202,7 +207,7 @@ export default {
|
||||
async getGoodsDetail(type){
|
||||
const { goods_id, temple_id } = this.$route.query;
|
||||
const response = await getGoodsDetail(type, goods_id, temple_id);
|
||||
if(this.query.goods_type === '-2'){
|
||||
if(this.query.goods_type === '2'){
|
||||
response.spec = response.spec.map(v => ({ ...v, money: this.amountAbs(v.donate_number, Number(response.price))}))
|
||||
}
|
||||
this.data = response;
|
||||
@@ -211,12 +216,12 @@ export default {
|
||||
onPriceUnit({id, money}){
|
||||
this.priceUnit = Number(money);
|
||||
this.priceUnitId = id;
|
||||
if(this.query.goods_type === '-2'){
|
||||
if(this.query.goods_type === '2'){
|
||||
this.is_assign = false;
|
||||
}
|
||||
},
|
||||
onToPay(){
|
||||
if(this.query.goods_type === '-1'){
|
||||
if(this.query.goods_type === '1'){
|
||||
this.$router.push({
|
||||
name: 'pay',
|
||||
query: {
|
||||
@@ -232,7 +237,7 @@ export default {
|
||||
}
|
||||
})
|
||||
}
|
||||
if(this.query.goods_type === '-2'){
|
||||
if(this.query.goods_type === '2'){
|
||||
this.$router.push({
|
||||
name: 'pay',
|
||||
query: {
|
||||
|
||||
Reference in New Issue
Block a user