Browse Source

Merge remote-tracking branch 'origin/yuenan' into yuenan

yuenan
娄梦宁 3 years ago
parent
commit
b6c2620f27
9 changed files with 53 additions and 35 deletions
  1. +1
    -1
      addons/unishop/uniapp/uni-shop/main.js
  2. +44
    -26
      addons/unishop/uniapp/uni-shop/pages/order/createOrder.vue
  3. +4
    -4
      addons/unishop/uniapp/uni-shop/pages/product/product.vue
  4. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/index.html
  5. +1
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.90f41dd2.js
  6. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-createOrder.3b598ae3.js
  7. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-createOrder.b96d2d52.js
  8. +1
    -0
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-product-product.368138ff.js
  9. +0
    -1
      addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-product-product.4ecbd70a.js

+ 1
- 1
addons/unishop/uniapp/uni-shop/main.js View File

@@ -170,7 +170,7 @@ const request = async (url, method = 'GET', data = {}, showMsg = true) => {
}

// 跳转判断是否登录
const navTo = (url, check = true) => {
const navTo = (url, check = false) => {
if (check && !Vue.prototype.$store.state.hasLogin) {
url = '/pages/public/login';
}


+ 44
- 26
addons/unishop/uniapp/uni-shop/pages/order/createOrder.vue View File

@@ -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;
}


+ 4
- 4
addons/unishop/uniapp/uni-shop/pages/product/product.vue View File

@@ -145,13 +145,13 @@
<text>购物车</text>
<text class="cart-count" v-if="product.cart_num">{{product.cart_num}}</text>
</navigator> -->
<view class="p-b-btn" :class="{active: favorite}" @click="toFavorite" v-if="!flash">
<!-- <view class="p-b-btn" :class="{active: favorite}" @click="toFavorite" v-if="!flash">
<text class="yticon icon-shoucang"></text>
<text>收藏</text>
</view>
</view> -->
<view class="p-b-btn" @click="showServe" v-if="!flash">
<text class="yticon icon-shouhou"></text>
<text>客</text>
<text>客</text>
</view>
<view class="p-b-btn" v-else>
<!-- 站位 -->
@@ -440,7 +440,7 @@
showServe(){
uni.showModal({
showCancel: false,
title: '客',
title: '客',
content: ' 请拨打客服电话:\n021-12345678'
})
},


+ 1
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/index.html View File

@@ -1,3 +1,3 @@
<!DOCTYPE html><html lang=zh-CN><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1"><title>宜家自购商城</title><script>document.addEventListener('DOMContentLoaded', function() {
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
})</script><link rel=stylesheet href=/h5/static/index.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script>/*BAIDU_STAT*/</script><script src=/h5/static/js/chunk-vendors.83ec382e.js></script><script src=/h5/static/js/index.d2f4d113.js></script></body></html>
})</script><link rel=stylesheet href=/h5/static/index.css></head><body><noscript><strong>Please enable JavaScript to continue.</strong></noscript><div id=app></div><script>/*BAIDU_STAT*/</script><script src=/h5/static/js/chunk-vendors.83ec382e.js></script><script src=/h5/static/js/index.90f41dd2.js></script></body></html>

addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/index.90f41dd2.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-createOrder.3b598ae3.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-order-createOrder.b96d2d52.js
File diff suppressed because it is too large
View File


+ 1
- 0
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-product-product.368138ff.js
File diff suppressed because it is too large
View File


+ 0
- 1
addons/unishop/uniapp/uni-shop/unpackage/dist/build/h5/static/js/pages-product-product.4ecbd70a.js
File diff suppressed because it is too large
View File


Loading…
Cancel
Save