|
|
@@ -2,23 +2,27 @@ |
|
|
|
<view> |
|
|
|
<view class="row b-b"> |
|
|
|
<text class="tit">联系人</text> |
|
|
|
<input class="input" type="text" v-model="addressData.name" placeholder="收货人姓名" placeholder-class="placeholder" /> |
|
|
|
<input class="input" type="text" v-model="addressData.name" placeholder="收货人姓名" |
|
|
|
placeholder-class="placeholder" /> |
|
|
|
</view> |
|
|
|
<view class="row b-b"> |
|
|
|
<text class="tit">手机号</text> |
|
|
|
<input class="input" type="number" v-model="addressData.mobile" placeholder="收货人手机号码" placeholder-class="placeholder" /> |
|
|
|
<input class="input" type="number" v-model="addressData.mobile" placeholder="收货人手机号码" |
|
|
|
placeholder-class="placeholder" /> |
|
|
|
</view> |
|
|
|
<view class="row b-b"> |
|
|
|
<text class="tit">地址</text> |
|
|
|
<input class="input" type="text" v-model="addressData.address" placeholder="详细地址,楼号" placeholder-class="placeholder" /> |
|
|
|
<input class="input" type="text" v-model="addressData.address" placeholder="详细地址,楼号" |
|
|
|
placeholder-class="placeholder" /> |
|
|
|
</view> |
|
|
|
<view class="row b-b"> |
|
|
|
<text class="tit">邮箱</text> |
|
|
|
<input class="input" type="text" v-model="addressData.email" placeholder="邮箱" placeholder-class="placeholder" /> |
|
|
|
<input class="input" type="text" v-model="addressData.email" placeholder="邮箱" |
|
|
|
placeholder-class="placeholder" /> |
|
|
|
</view> |
|
|
|
|
|
|
|
|
|
|
|
<view class="progress" v-if="progress.number"> |
|
|
|
|
|
|
|
|
|
|
|
<!-- <ProgressBar |
|
|
|
class="ProgressBar" |
|
|
|
:Sold="progress.sold" |
|
|
@@ -39,14 +43,22 @@ |
|
|
|
<image :src="item.image" mode="aspectFill"></image> |
|
|
|
<view class="right"> |
|
|
|
<text class="title clamp">{{item.title}}</text> |
|
|
|
<view class="spec">{{item.spec ? "规格:" + item.spec : ""}} {{" 库存:"+item.stock}} {{progress.number ? "(秒:"+progress.number+"件,剩:"+(progress.number - progress.sold)+"件)": ""}}</view> |
|
|
|
<view class="spec">{{item.spec ? "规格:" + item.spec : ""}} {{" 库存:"+item.stock}} |
|
|
|
{{progress.number ? "(秒:"+progress.number+"件,剩:"+(progress.number - progress.sold)+"件)": ""}} |
|
|
|
</view> |
|
|
|
<view class="price-box"> |
|
|
|
<view class="price">¥{{item.sales_price}} <del class="market_price">¥{{item.market_price}}</del></view> |
|
|
|
<view class="price">¥{{item.sales_price}} <del class="market_price">¥{{item.market_price}}</del> |
|
|
|
</view> |
|
|
|
<!-- <text class="number">x 1</text> --> |
|
|
|
<uni-number-box v-if="progress.number" class="step" :min="1" :max="progress.number - progress.sold" :disabled="item.number>=(progress.number - progress.sold)" :value="item.number" :isMax="(progress.number - progress.sold) <= item.number?true:false" |
|
|
|
:isMin="item.number===1" :index="index" @eventChange="numberChange"></uni-number-box> |
|
|
|
<uni-number-box v-else class="step" :min="1" :max="item.stock" :disabled="item.number>=item.stock" :value="item.number" :isMax="item.stock <= item.number?true:false" |
|
|
|
:isMin="item.number===1" :index="index" @eventChange="numberChange"></uni-number-box> |
|
|
|
<uni-number-box v-if="progress.number" class="step" :min="1" |
|
|
|
:max="progress.number - progress.sold" |
|
|
|
:disabled="item.number>=(progress.number - progress.sold)" :value="item.number" |
|
|
|
:isMax="(progress.number - progress.sold) <= item.number?true:false" |
|
|
|
:isMin="item.number===1" :index="index" @eventChange="numberChange"></uni-number-box> |
|
|
|
<uni-number-box v-else class="step" :min="1" :max="item.stock" |
|
|
|
:disabled="item.number>=item.stock" :value="item.number" |
|
|
|
:isMax="item.stock <= item.number?true:false" :isMin="item.number===1" :index="index" |
|
|
|
@eventChange="numberChange"></uni-number-box> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
</view> |
|
|
@@ -97,7 +109,8 @@ |
|
|
|
</view> |
|
|
|
<view class="yt-list-cell desc-cell"> |
|
|
|
<view class="cell-tit clamp">备注</view> |
|
|
|
<input class="desc" type="text" v-model="remark" placeholder="请填写备注信息" placeholder-class="placeholder" /> |
|
|
|
<input class="desc" type="text" v-model="remark" placeholder="请填写备注信息" |
|
|
|
placeholder-class="placeholder" /> |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
|
|
|
@@ -115,7 +128,8 @@ |
|
|
|
<view class="mask" :class="maskState===0 ? 'none' : maskState===1 ? 'show' : ''" @click="toggleMask"> |
|
|
|
<view class="mask-content" @click.stop.prevent="stopPrevent"> |
|
|
|
<!-- 优惠券页面,仿mt --> |
|
|
|
<view class="coupon-item" v-for="(item,index) in couponList" :key="index" :class="useCouponIndex === index ? 'selectCoupon' : ''"> |
|
|
|
<view class="coupon-item" v-for="(item,index) in couponList" :key="index" |
|
|
|
:class="useCouponIndex === index ? 'selectCoupon' : ''"> |
|
|
|
<view class="con" v-on:click="useCoupon(index)"> |
|
|
|
<view class="left"> |
|
|
|
<text class="title">{{item.title}}</text> |
|
|
@@ -150,6 +164,7 @@ |
|
|
|
address: '', |
|
|
|
email: '' |
|
|
|
}, |
|
|
|
id: "", //商品ID |
|
|
|
maskState: 0, //优惠券面板显示状态 |
|
|
|
remark: '', //备注 |
|
|
|
payType: 1, //1微信 2支付宝 |
|
|
@@ -164,11 +179,12 @@ |
|
|
|
deliveryPrice: 0.00, |
|
|
|
cart: [], // 购物车id |
|
|
|
flash_id: 0, // 秒杀id |
|
|
|
progress:{}, |
|
|
|
submitLock:false // 提交按钮锁 |
|
|
|
progress: {}, |
|
|
|
submitLock: false // 提交按钮锁 |
|
|
|
} |
|
|
|
}, |
|
|
|
onLoad(options) { |
|
|
|
this.id = options.id; |
|
|
|
if (options.hasOwnProperty('flash_id')) { |
|
|
|
this.flash_id = options.flash_id; |
|
|
|
} |
|
|
@@ -188,8 +204,7 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
}, |
|
|
|
onShow() { |
|
|
|
}, |
|
|
|
onShow() {}, |
|
|
|
methods: { |
|
|
|
// 计算百分比 |
|
|
|
percentage(number, sold) { |
|
|
@@ -222,7 +237,7 @@ |
|
|
|
this.couponList = data.coupon; |
|
|
|
this.deliveryList = data.delivery; |
|
|
|
this.calcTotal(); |
|
|
|
|
|
|
|
|
|
|
|
if (data.flash) { |
|
|
|
this.progress = data.flash; |
|
|
|
} |
|
|
@@ -267,13 +282,15 @@ |
|
|
|
|
|
|
|
this.$api.msg('提交中...', 20000); |
|
|
|
let delivery_id = 0; |
|
|
|
if (this.deliveryList && this.deliveryList[this.deliveryIndex] && this.deliveryList[this.deliveryIndex].id) { |
|
|
|
if (this.deliveryList && this.deliveryList[this.deliveryIndex] && this.deliveryList[this.deliveryIndex] |
|
|
|
.id) { |
|
|
|
delivery_id = this.deliveryList[this.deliveryIndex].id; |
|
|
|
} |
|
|
|
let coupon_id = 0; |
|
|
|
if (this.couponList && this.couponList[this.useCouponIndex] && this.couponList[this.useCouponIndex].id) { |
|
|
|
if (this.couponList && this.couponList[this.useCouponIndex] && this.couponList[this.useCouponIndex] |
|
|
|
.id) { |
|
|
|
coupon_id = this.couponList[this.useCouponIndex].id; |
|
|
|
} |
|
|
|
} |
|
|
|
let data = { |
|
|
|
name: this.addressData.name, |
|
|
|
mobile: this.addressData.mobile, |
|
|
@@ -303,11 +320,11 @@ |
|
|
|
let result = await this.$api.request(apiUrl, 'POST', data); |
|
|
|
if (result) { |
|
|
|
this.submitLock = false; // 解除锁 |
|
|
|
this.$api.msg('已提交', 2000); |
|
|
|
this.$api.msg('已提交', 2000); |
|
|
|
uni.redirectTo({ |
|
|
|
url: `/pages/money/pay?order_id=${result.order_id}&total=${this.total}&out_trade_no=${result.out_trade_no}` |
|
|
|
url: `/pages/product/product?id=${this.id}&flash=0` |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
this.submitLock = false; // 解除锁 |
|
|
|
}, |
|
|
|
stopPrevent() {}, |
|
|
@@ -687,7 +704,8 @@ |
|
|
|
&.red { |
|
|
|
color: $base-color; |
|
|
|
} |
|
|
|
picker{ |
|
|
|
|
|
|
|
picker { |
|
|
|
max-width: 500rpx; |
|
|
|
line-height: 50rpx; |
|
|
|
} |
|
|
|