|
@@ -11,7 +11,10 @@
|
|
|
</flexbox-item>
|
|
|
</flexbox>
|
|
|
<div v-else>
|
|
|
- <p style="text-align: center;color:#EB4E4F; padding: 50px 0;background: #fff; font-size: 26px;"><icon type="warn"></icon>请填写收货人信息</p>
|
|
|
+ <p style="text-align: center;color:#EB4E4F; padding: 50px 0;background: #fff; font-size: 26px;">
|
|
|
+ <icon type="warn"></icon>
|
|
|
+ 请填写收货人信息
|
|
|
+ </p>
|
|
|
</div>
|
|
|
</div>
|
|
|
<group>
|
|
@@ -32,7 +35,8 @@
|
|
|
<flexbox-item :span="3/6" style="padding-left: 25px;">
|
|
|
<p>{{goods.goods_mobile_name}}</p>
|
|
|
<p style="margin: 20px 0 40px 0;" class="letter_pro">{{goods.goods_spec}}</p>
|
|
|
- <p><span class="letter_warn" style="margin-right: 10px; font-size: 30px;">¥{{goods.act_type == 0?goods.bonus_price:goods.goods_promotion_price}}</span><span class="letter_pro">专柜价{{goods.goods_price}}</span></p>
|
|
|
+ <p><span class="letter_warn" style="margin-right: 10px; font-size: 30px;">¥{{goods.act_type == 0?goods.bonus_price:goods.goods_promotion_price}}</span><span
|
|
|
+ class="letter_pro">专柜价{{goods.goods_price}}</span></p>
|
|
|
</flexbox-item>
|
|
|
<flexbox-item style="text-align: right;">
|
|
|
<span class="letter_pro">x{{goods.goods_num}}</span>
|
|
@@ -40,29 +44,36 @@
|
|
|
</flexbox>
|
|
|
</flexbox-item>
|
|
|
</flexbox>
|
|
|
- <div style="background: #fff; padding:20px 0 20px 30px;" v-if="datas.payinfo.gap_desc"><span class="letter_pro">{{datas.payinfo.gap_desc}}</span></div>
|
|
|
+ <div style="background: #fff; padding:20px 0 20px 30px;" v-if="datas.payinfo.gap_desc"><span
|
|
|
+ class="letter_pro">{{datas.payinfo.gap_desc}}</span></div>
|
|
|
<div class="entry">
|
|
|
<flexbox>
|
|
|
<flexbox-item>
|
|
|
<flexbox>
|
|
|
<flexbox-item :span="4/5" style="line-height: 50px;">商品总价</flexbox-item>
|
|
|
- <flexbox-item :span="1/5" style="text-align: right"><span class="letter_warn">¥ {{datas.payinfo['goods_amount']}}</span></flexbox-item>
|
|
|
+ <flexbox-item :span="1/5" style="text-align: right"><span class="letter_warn">¥ {{datas.payinfo['goods_amount']}}</span>
|
|
|
+ </flexbox-item>
|
|
|
</flexbox>
|
|
|
</flexbox-item>
|
|
|
</flexbox>
|
|
|
<flexbox>
|
|
|
<flexbox-item>
|
|
|
<flexbox>
|
|
|
- <flexbox-item :span="4/5" style="line-height: 50px;">{{datas.payinfo['full_desc']}}</flexbox-item>
|
|
|
- <flexbox-item :span="1/5" style="text-align: right" v-if="datas.payinfo['full_desc']"><span class="letter_info">- ¥ {{datas.payinfo['full_discount']}}</span></flexbox-item>
|
|
|
+ <flexbox-item :span="4/5" style="line-height: 50px;">{{datas.payinfo['full_desc']}}
|
|
|
+ </flexbox-item>
|
|
|
+ <flexbox-item :span="1/5" style="text-align: right" v-if="datas.payinfo['full_desc']"><span
|
|
|
+ class="letter_info">- ¥ {{datas.payinfo['full_discount']}}</span></flexbox-item>
|
|
|
</flexbox>
|
|
|
</flexbox-item>
|
|
|
</flexbox>
|
|
|
<flexbox>
|
|
|
<flexbox-item>
|
|
|
<flexbox v-for="bonus in datas.payinfo['bonus_rates']" :key="bonus">
|
|
|
- <flexbox-item :span="4/5" style="line-height: 50px;"><span class="bonus_bg"><span class="bonus_rate">{{bonus.rate}}%</span></span>红包抵扣</flexbox-item>
|
|
|
- <flexbox-item :span="1/5" style="text-align: right"><span class="letter_info">- ¥ {{bonus.total}}</span></flexbox-item>
|
|
|
+ <flexbox-item :span="4/5" style="line-height: 50px;"><span class="bonus_bg"><span
|
|
|
+ class="bonus_rate">{{bonus.rate}}%</span></span>红包抵扣
|
|
|
+ </flexbox-item>
|
|
|
+ <flexbox-item :span="1/5" style="text-align: right"><span class="letter_info">- ¥ {{bonus.total}}</span>
|
|
|
+ </flexbox-item>
|
|
|
</flexbox>
|
|
|
</flexbox-item>
|
|
|
</flexbox>
|
|
@@ -70,25 +81,31 @@
|
|
|
<flexbox-item>
|
|
|
<flexbox>
|
|
|
<flexbox-item :span="4/5" style="line-height: 50px;">运费</flexbox-item>
|
|
|
- <flexbox-item :span="1/5" style="text-align: right"><span class="letter_warn">+ ¥ {{datas.payinfo['freight']}}</span></flexbox-item>
|
|
|
+ <flexbox-item :span="1/5" style="text-align: right"><span class="letter_warn">+ ¥ {{datas.payinfo['freight']}}</span>
|
|
|
+ </flexbox-item>
|
|
|
</flexbox>
|
|
|
</flexbox-item>
|
|
|
</flexbox>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="order_pay">
|
|
|
- <div class="default_address" v-if="datas.address !== null">配送至:{{store_address?store_address.address:datas.address.area_info+datas.address.address}}</div>
|
|
|
+ <div class="default_address" v-if="datas.address !== null">
|
|
|
+ 配送至:{{store_address?store_address.address:datas.address.area_info+datas.address.address}}
|
|
|
+ </div>
|
|
|
<div class="just_buy">
|
|
|
<flexbox>
|
|
|
- <flexbox-item :span="4/6" style="text-align: center;line-height: 93px; font-size: 30px;">应付: <span class="letter_warn">¥ {{datas.payinfo['pay_cash_pred']}}</span></flexbox-item>
|
|
|
- <flexbox-item :span="2/6" style="text-align: center;background:#EB4E4F;color: #fff;line-height: 93px; "><p @click="onBridgeReady">去付款</p></flexbox-item>
|
|
|
+ <flexbox-item :span="4/6" style="text-align: center;line-height: 93px; font-size: 30px;">应付: <span
|
|
|
+ class="letter_warn">¥ {{datas.payinfo['pay_cash_pred']}}</span></flexbox-item>
|
|
|
+ <flexbox-item :span="2/6"
|
|
|
+ style="text-align: center;background:#EB4E4F;color: #fff;line-height: 93px; "><p
|
|
|
+ @click="onBridgeReady">去付款</p></flexbox-item>
|
|
|
</flexbox>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
- import { Flexbox,FlexboxItem,Group,CellBox,XSwitch,XInput,Icon} from 'vux'
|
|
|
+ import {Flexbox, FlexboxItem, Group, CellBox, XSwitch, XInput, Icon} from 'vux'
|
|
|
import Api from '../../lib/api'
|
|
|
import Proxy from '../blocks/util/proxy'
|
|
|
|
|
@@ -100,20 +117,20 @@
|
|
|
let goods_id = this.$route.query["goods_id"];
|
|
|
let goods_num = this.$route.query['num'];
|
|
|
let iscart = this.$route.query["iscart"];
|
|
|
- let cart_id = this.$route.query["cart_id"]?this.$route.query["cart_id"]:'';
|
|
|
- this.$http.jsonp(Api.step_first(iscart,cart_id,goods_id,goods_num)).then(function(res){
|
|
|
- if(res.body.datas == null && res.body.code !== '200') {
|
|
|
+ let cart_id = this.$route.query["cart_id"] ? this.$route.query["cart_id"] : '';
|
|
|
+ this.$http.jsonp(Api.step_first(iscart, cart_id, goods_id, goods_num)).then(function (res) {
|
|
|
+ if (res.body.datas == null && res.body.code !== '200') {
|
|
|
this.$vux.toast.show({
|
|
|
- type:'warn',
|
|
|
+ type: 'warn',
|
|
|
text: res.body.message,
|
|
|
- position:'middle',
|
|
|
- width:'600px'
|
|
|
+ position: 'middle',
|
|
|
+ width: '600px'
|
|
|
});
|
|
|
this.$router.go(-1);
|
|
|
}
|
|
|
else {
|
|
|
this.datas = res.body['datas'];
|
|
|
- this.proxy = new Proxy(res.body['datas']);
|
|
|
+ this.proxy.addData(res.bodyText);
|
|
|
this.$store.commit('updateLoadingStatus', {isLoading: false});
|
|
|
}
|
|
|
})
|
|
@@ -123,27 +140,26 @@
|
|
|
'name': '',
|
|
|
'mobile': '',
|
|
|
'address': '',
|
|
|
- 'aid' : ''
|
|
|
+ 'aid': ''
|
|
|
});
|
|
|
},
|
|
|
data ()
|
|
|
{
|
|
|
return {
|
|
|
- datas : '',
|
|
|
- proxy:{},
|
|
|
- aid:''
|
|
|
+ datas: '',
|
|
|
+ proxy: new Proxy(),
|
|
|
+ aid: ''
|
|
|
}
|
|
|
},
|
|
|
- computed:
|
|
|
- {
|
|
|
+ computed: {
|
|
|
default_address(){
|
|
|
let address_list = this.datas['address'];
|
|
|
},
|
|
|
goods_list(){
|
|
|
- if(!this.datas)return;
|
|
|
+ if (!this.datas)return;
|
|
|
let goods_list = this.datas.goods_list;
|
|
|
let list = [];
|
|
|
- for(let i =0;i<goods_list.length;i++) {
|
|
|
+ for (let i = 0; i < goods_list.length; i++) {
|
|
|
let goods_item = this.proxy.getSummery(goods_list[i].goods_id);
|
|
|
goods_item.goods_num = goods_list[i].goods_num;
|
|
|
list.push(goods_item);
|
|
@@ -152,7 +168,7 @@
|
|
|
},
|
|
|
store_address(){
|
|
|
let address;
|
|
|
- if(this.$store.state.address['name']) {
|
|
|
+ if (this.$store.state.address['name']) {
|
|
|
address = this.$store.state.address;
|
|
|
return address;
|
|
|
}
|
|
@@ -161,43 +177,55 @@
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
- methods:
|
|
|
- {
|
|
|
+ methods: {
|
|
|
link_address(){
|
|
|
- this.$router.push({path:'/address/list',query:{need_goBack:true}});
|
|
|
+ this.$router.push({path: '/address/list', query: {need_goBack: true}});
|
|
|
},
|
|
|
onBridgeReady(){
|
|
|
let goods_id = this.$route.query["goods_id"];
|
|
|
let goods_num = this.$route.query['num'];
|
|
|
let iscart = this.$route.query["iscart"];
|
|
|
- let cart_id = this.$route.query["cart_id"]?this.$route.query["cart_id"]:'';
|
|
|
+ let cart_id = this.$route.query["cart_id"] ? this.$route.query["cart_id"] : '';
|
|
|
let vat_hash = this.datas['payinfo'].vat_hash;
|
|
|
let offpay_hash = this.datas['payinfo'].offpay_hash;
|
|
|
let offpay_hash_batch = this.datas['payinfo'].offpay_hash_batch;
|
|
|
- let address_id = this.store_address?this.store_address.aid:this.datas['address'].address_id;
|
|
|
+ let address_id = this.store_address ? this.store_address.aid : this.datas['address'].address_id;
|
|
|
console.log(address_id);
|
|
|
- this.$http.jsonp(Api.step_second(cart_id,goods_id,goods_num,address_id,0,vat_hash,offpay_hash,offpay_hash_batch)).then(function(res){
|
|
|
- let param = res.body.datas.param.data;
|
|
|
- WeixinJSBridge.invoke(
|
|
|
- 'getBrandWCPayRequest', {
|
|
|
- "appId": param.appId, //公众号名称,由商户传入
|
|
|
- "timeStamp": param.timeStamp, //时间戳,自1970年以来的秒数
|
|
|
- "nonceStr": param.nonceStr, //随机串
|
|
|
- "package": param.package,
|
|
|
- "signType": param.signType, //微信签名方式:
|
|
|
- "paySign": param.paySign //微信签名
|
|
|
- },
|
|
|
- function (res) {
|
|
|
- if (res.err_msg == "get_brand_wcpay_request:ok") {
|
|
|
- alert('支付成功');
|
|
|
- } // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回 ok,但并不保证它绝对可靠。
|
|
|
+ this.$http.jsonp(Api.step_second(cart_id, goods_id, goods_num, address_id, 0, vat_hash, offpay_hash, offpay_hash_batch)).then(function (res) {
|
|
|
+ if (res.status == 200 && res.body.code == 200) {
|
|
|
+ let param = res.body.datas.param.data;
|
|
|
+ WeixinJSBridge.invoke(
|
|
|
+ 'getBrandWCPayRequest', {
|
|
|
+ "appId": param.appId, //公众号名称,由商户传入
|
|
|
+ "timeStamp": param.timeStamp, //时间戳,自1970年以来的秒数
|
|
|
+ "nonceStr": param.nonceStr, //随机串
|
|
|
+ "package": param.package,
|
|
|
+ "signType": param.signType, //微信签名方式:
|
|
|
+ "paySign": param.paySign //微信签名
|
|
|
+ },
|
|
|
+ function (res) {
|
|
|
+ if (res.err_msg == "get_brand_wcpay_request:ok") {
|
|
|
+ alert('支付成功');
|
|
|
+ } // 使用以上方式判断前端返回,微信团队郑重提示:res.err_msg将在用户支付成功后返回 ok,但并不保证它绝对可靠。
|
|
|
+ }
|
|
|
+ );
|
|
|
+ } else {
|
|
|
+ let msg;
|
|
|
+ if (res.status != 200) {
|
|
|
+ msg = "网络错误!";
|
|
|
+ } else {
|
|
|
+ msg = res.body.message;
|
|
|
}
|
|
|
- );
|
|
|
+ this.$vux.toast.show({
|
|
|
+ type: 'text',
|
|
|
+ text: msg,
|
|
|
+ position: 'middle'
|
|
|
+ });
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
},
|
|
|
- components:
|
|
|
- {
|
|
|
+ components: {
|
|
|
Flexbox,
|
|
|
FlexboxItem,
|
|
|
Group,
|
|
@@ -212,12 +240,15 @@
|
|
|
#router_view {
|
|
|
background: #f9f9f9;
|
|
|
}
|
|
|
+
|
|
|
.address_box {
|
|
|
- padding:24px 0 24px 40px;
|
|
|
+ padding: 24px 0 24px 40px;
|
|
|
}
|
|
|
+
|
|
|
.address_box p {
|
|
|
line-height: 50px;
|
|
|
}
|
|
|
+
|
|
|
.address_icon {
|
|
|
display: inline-block;
|
|
|
width: 34px;
|
|
@@ -225,24 +256,29 @@
|
|
|
background: url("../../assets/address_icon.jpg") no-repeat;
|
|
|
background-size: 100% 100%;
|
|
|
}
|
|
|
+
|
|
|
.check_order {
|
|
|
padding-bottom: 133px;
|
|
|
}
|
|
|
+
|
|
|
.entry {
|
|
|
background: #fff;
|
|
|
margin-top: 0.71428571em;
|
|
|
padding: 30px;
|
|
|
}
|
|
|
+
|
|
|
.order_pay {
|
|
|
position: fixed;
|
|
|
bottom: 0;
|
|
|
left: 0;
|
|
|
width: 100%;
|
|
|
}
|
|
|
+
|
|
|
.just_buy {
|
|
|
height: 93px;
|
|
|
background: #fff;
|
|
|
}
|
|
|
+
|
|
|
.default_address {
|
|
|
font-size: 18px;
|
|
|
background: #ffeab8;
|
|
@@ -251,23 +287,29 @@
|
|
|
line-height: 40px;
|
|
|
padding-left: 30px;
|
|
|
}
|
|
|
+
|
|
|
.bonus_bg {
|
|
|
background: #f2bb11;
|
|
|
padding: 5px;
|
|
|
margin-right: 5px;
|
|
|
}
|
|
|
+
|
|
|
.bonus_rate {
|
|
|
border: 1px dashed #fff;
|
|
|
}
|
|
|
+
|
|
|
.letter_pro {
|
|
|
color: #a7a7a7;
|
|
|
}
|
|
|
+
|
|
|
.letter_info {
|
|
|
color: #09BB07;
|
|
|
}
|
|
|
+
|
|
|
.letter_warn {
|
|
|
color: #EB4E4F;
|
|
|
}
|
|
|
+
|
|
|
.weui-icon-warn {
|
|
|
vertical-align: text-bottom;
|
|
|
font-size: 34px;
|