提交 d26bd316 authored 作者: 王鹏飞's avatar 王鹏飞

bug fixes

上级 eb4ce641
......@@ -13,7 +13,12 @@
</div>
<van-field :label="spec_title" class="tag-item is-vertical">
<template #input>
<tag-selection v-model="spec" :data="specList" :options="{ label: 'spec_values', value: 'sku_id' }" @currentSelected="handleTagSelected" />
<tag-selection
v-model="spec"
:data="specList"
:options="{ label: 'spec_values', value: 'sku_id' }"
@currentSelected="handleTagSelected"
/>
</template>
<!-- 提示 -->
<template #extra v-if="options.spare">
......@@ -51,7 +56,13 @@
<van-button type="primary" round block color="#C01540" size="small">下一步</van-button>
</div>
</van-form>
<van-dialog v-model="dialogVisiable" title="请选择支付方式" show-cancel-button getContainer="body" @confirm="handleDialogConfirm">
<van-dialog
v-model="dialogVisiable"
title="请选择支付方式"
show-cancel-button
getContainer="body"
@confirm="handleDialogConfirm"
>
<van-radio-group v-model="payType">
<van-radio name="12">支付宝支付</van-radio>
<van-radio name="4">微信支付</van-radio>
......@@ -242,8 +253,8 @@ export default {
spu_id: this.spu_id
}
getGoodsSpecs(params).then(res => {
this.specList = res.data
const [first = {}] = res.data
this.specList = res.data || []
const [first = {}] = res.data || []
this.spec_title = first.spec_names
this.spec = first.sku_id
this.price = first.price
......
......@@ -2,11 +2,16 @@
<div class="buy-container">
<van-swipe class="my-swipe" indicator-color="white" @change="index => (swipeAcitve = index)">
<van-swipe-item class="video" v-if="details.main_chart_oss" @click="handleVideoClick">
<video :src="details.main_chart_oss" playsinline :poster="`${details.main_chart_oss}?x-oss-process=video/snapshot,t_10,f_jpg,w_0,h_0,m_fast`" ref="video"></video>
<video
:src="details.main_chart_oss"
playsinline
:poster="`${details.main_chart_oss}?x-oss-process=video/snapshot,t_10,f_jpg,w_0,h_0,m_fast`"
ref="video"
></video>
<van-icon :name="videoPlay ? 'pause-circle-o' : 'play-circle-o'" />
</van-swipe-item>
<van-swipe-item v-for="(item, index) in imgList" :key="item.url">
<img v-if="swipeAcitve === index + 1" :src="item.url" />
<img v-if="swipeAcitve === (details.main_chart_oss ? index + 1 : index)" :src="item.url" />
</van-swipe-item>
</van-swipe>
<div class="item price-item">
......@@ -42,7 +47,9 @@
<div v-html="details.spu_context"></div>
</div>
<div class="bottom-bar" v-if="details.status === '2'">
<van-button type="primary" round block color="#C01540" size="small" @click="handleBuy">{{ details.buy_button_text || '立即购买' }}</van-button>
<van-button type="primary" round block color="#C01540" size="small" @click="handleBuy">{{
details.buy_button_text || '立即购买'
}}</van-button>
</div>
<buy-popup v-model="popupVisiable" :options="popupOptions" @placeOrder="handlePlaceOrder" />
<phone-code-login-popup v-model="loginPopupVisiable" @loginSuccess="popupVisiable = true" />
......@@ -167,7 +174,9 @@ export default {
this.fetchPlaceOrder(params)
},
getCode() {
const redirectURI = `https://pages.ezijing.com/given/auth.html?redirect_uri=${encodeURIComponent(window.location.href)}`
const redirectURI = `https://pages.ezijing.com/given/auth.html?redirect_uri=${encodeURIComponent(
window.location.href
)}`
window.location.href = `https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx451c01d40d090d7a&redirect_uri=${redirectURI}&response_type=code&scope=snsapi_base#wechat_redirect`
},
// 获取微信openid
......@@ -196,7 +205,6 @@ export default {
if (typeof imgsJson === 'string' && Array.isArray(JSON.parse(imgsJson))) {
this.imgList = JSON.parse(imgsJson)
}
this.swipeAcitve = first.main_chart_oss ? 0 : 1
this.popupOptions = {
spare: this.spare,
goods: first,
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论