Browse Source

优化部分页面、对接确认订单使用红包

master
ltlzx 3 years ago
parent
commit
f636691cd7
  1. 13
      pages/account/myOrders.vue
  2. 20
      pages/account/myReview.vue
  3. 32
      pages/index/index.vue
  4. 27
      pages/order/confirmation.vue
  5. 10
      pages/productDetails/index.vue

13
pages/account/myOrders.vue

@ -153,6 +153,7 @@
<!-- 待发货订单 --> <!-- 待发货订单 -->
<template v-if="isList==true && scroll_active==2"> <template v-if="isList==true && scroll_active==2">
<view v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==0" @click="goDetails(0,item.order_id)"> <view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==0" @click="goDetails(0,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>To be shipped</text> <text>To be shipped</text>
@ -197,9 +198,11 @@
<view class="good_price">total:US${{item.total_fee_o}}</view> <view class="good_price">total:US${{item.total_fee_o}}</view>
</view> </view>
</view> </view>
</view>
</template> </template>
<!-- 运输中订单 --> <!-- 运输中订单 -->
<template v-if="isList==true && scroll_active==3"> <template v-if="isList==true && scroll_active==3">
<view v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4" @click="goDetails(4,item.order_id)"> <view class="order" v-if="item.pay_status_code==2 && item.shipping_status_code==1 || item.shipping_status_code==4" @click="goDetails(4,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>Shipped</text> <text>Shipped</text>
@ -248,9 +251,11 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<!-- 已完成订单 --> <!-- 已完成订单 -->
<template v-if="isList==true && scroll_active==4"> <template v-if="isList==true && scroll_active==4">
<view class="" v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order " v-if="item.pay_status_code==2 && item.shipping_status_code==2" @click="goDetails(2,item.order_id)"> <view class="order " v-if="item.pay_status_code==2 && item.shipping_status_code==2" @click="goDetails(2,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>Completed</text> <text>Completed</text>
@ -299,9 +304,11 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<!-- 退换货订单 --> <!-- 退换货订单 -->
<template v-if="isList==true && scroll_active==5"> <template v-if="isList==true && scroll_active==5">
<view class="" v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" v-if="item.order_status_code==4" @click="goDetails(2,item.order_id)"> <view class="order" v-if="item.order_status_code==4" @click="goDetails(2,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>Return and exchange</text> <text>Return and exchange</text>
@ -349,9 +356,11 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<!-- 已取消订单 --> <!-- 已取消订单 -->
<template v-if="isList==true && scroll_active==6"> <template v-if="isList==true && scroll_active==6">
<view class="" v-for="(item,idnex) in orderList" :key="item.order_id">
<view class="order" v-if="item.order_status_code==2" @click="goDetails(1,item.order_id)"> <view class="order" v-if="item.order_status_code==2" @click="goDetails(1,item.order_id)">
<view class="order_title"> <view class="order_title">
<text>cancelled</text> <text>cancelled</text>
@ -399,6 +408,7 @@
</view> </view>
</view> </view>
</view> </view>
</view>
</template> </template>
<template v-if="isList==false"> <template v-if="isList==false">
<view class="order1"> <view class="order1">
@ -584,8 +594,9 @@
orderInfo: res.data.prepay_data.order_info, // orderInfo: res.data.prepay_data.order_info, //
success: function (res) { success: function (res) {
console.log('success:' + JSON.stringify(res)); console.log('success:' + JSON.stringify(res));
this.isShow=false
uni.navigateTo({ uni.navigateTo({
url: 'paySuccess?order_id='+this.payQuery.order_id url: '../order/paySuccess?order_id='+this.payQuery.order_id
}); });
}, },
fail: function (err) { fail: function (err) {

20
pages/account/myReview.vue

@ -25,14 +25,30 @@
</template> </template>
<script> <script>
import {defaultRequest,defaultRequest2} from '../../api/index.js'
export default { export default {
data() { data() {
return { return {
isShwo:false isShwo:false,
query:{
_action:'getgoodscomment',
goods_id:'',
page_index:1,
page_size:10,
commentlabel:''
}
} }
}, },
methods:{ methods:{
getList(){
defaultRequest(this.query).then(res=>{
console.info(res)
})
}
},
onLoad(e) {
this.query.goods_id=e.goods_id
this.getList()
} }
} }
</script> </script>

32
pages/index/index.vue

@ -69,25 +69,30 @@
</swiper> </swiper>
</uni-swiper-dot> </uni-swiper-dot>
<!-- 打折 --> <!-- ONEPIC -->
<!-- class="discount page_padding" -->
<view class="ONEPIC" v-if="item.zone_code=='ONEPIC' && item.zone_status=='NORMAL'"> <view class="ONEPIC" v-if="item.zone_code=='ONEPIC' && item.zone_status=='NORMAL'">
<!-- class="discount page_padding" -->
<image :src="item.blocks[0].block_pic" mode="" ></image> <image :src="item.blocks[0].block_pic" mode="" ></image>
</view> </view>
<!-- TWOPIC -->
<view class="TWOPIC" v-if="item.zone_code=='TWOPIC' && item.zone_status=='NORMAL'"> <view class="TWOPIC" v-if="item.zone_code=='TWOPIC' && item.zone_status=='NORMAL'">
<image :src="item.blocks[0].block_pic" mode="" ></image> <image :src="item1.block_pic" mode="" v-for="(item1,index1) in item.blocks" :key="item1.block_id"></image>
</view> </view>
<!-- THREEPIC -->
<view class="THREEPIC" v-if="item.zone_code=='THREEPIC' && item.zone_status=='NORMAL'"> <view class="THREEPIC" v-if="item.zone_code=='THREEPIC' && item.zone_status=='NORMAL'">
<image :src="item.blocks[0].block_pic" mode="" ></image> <image :src="item1.block_pic" mode="" v-for="(item1,index1) in item.blocks" :key="item1.block_id"></image>
</view> </view>
<!-- FOURPIC -->
<view class="FOURPIC" v-if="item.zone_code=='FOURPIC' && item.zone_status=='NORMAL'"> <view class="FOURPIC" v-if="item.zone_code=='FOURPIC' && item.zone_status=='NORMAL'">
<image :src="item.blocks[0].block_pic" mode="" ></image> <image :src="item1.block_pic" mode="" v-for="(item1,index1) in item.blocks" :key="item1.block_id"></image>
</view> </view>
<!-- FIVEPIC -->
<view class="FIVEPIC" v-if="item.zone_code=='FIVEPIC' && item.zone_status=='NORMAL'"> <view class="FIVEPIC" v-if="item.zone_code=='FIVEPIC' && item.zone_status=='NORMAL'">
<image :src="item.blocks[0].block_pic" mode="" ></image> <image :src="item1.block_pic" mode="" v-for="(item1,index1) in item.blocks" :key="item1.block_id"></image>
</view> </view>
<!-- SIXPIC -->
<view class="SIXPIC" v-if="item.zone_code=='SIXPIC' && item.zone_status=='NORMAL'"> <view class="SIXPIC" v-if="item.zone_code=='SIXPIC' && item.zone_status=='NORMAL'">
<image :src="item.blocks[0].block_pic" mode="" ></image> <image :src="item1.block_pic" mode="" v-for="(item1,index1) in item.blocks" :key="item1.block_id"></image>
</view> </view>
@ -661,8 +666,12 @@
.hotSells1_item_img{ .hotSells1_item_img{
width: 100%; width: 100%;
height: 266.67rpx; height: 266.67rpx;
background-color: #999999; // background-color: #999999;
margin-bottom: 23.33rpx; margin-bottom: 23.33rpx;
image{
width: 100%;
height: 100%;
}
} }
} }
.hotSells2_item{ .hotSells2_item{
@ -673,8 +682,13 @@
.hotSells2_item_img{ .hotSells2_item_img{
width: 100%; width: 100%;
height: 224rpx; height: 224rpx;
background-color: #999999; // background-color: #999999;
margin-bottom: 25.33rpx; margin-bottom: 25.33rpx;
image{
width: 100%;
height: 100%;
}
} }
} }
} }

27
pages/order/confirmation.vue

@ -55,7 +55,7 @@
<view class="discount_item" @click="openMore(1)"> <view class="discount_item" @click="openMore(1)">
<text>Coupons</text> <text>Coupons</text>
<view class="discount_item_right"> <view class="discount_item_right">
<text v-show="isCoupons">-US$12.5</text> <text v-show="total.bonus!=0">-US${{total.bonus}}</text>
<image src="../../static/img/right.png" mode="" class="address_more"></image> <image src="../../static/img/right.png" mode="" class="address_more"></image>
</view> </view>
</view> </view>
@ -82,7 +82,7 @@
</view> </view>
<view class="settlement_item"> <view class="settlement_item">
<text>Discount :</text> <text>Discount :</text>
<text class="settlement_item_right1">-US${{total.discount || 0}}</text> <text class="settlement_item_right1">-US${{total.bonus || 0}}</text>
</view> </view>
</view> </view>
@ -124,20 +124,21 @@
</view> </view>
<view class="order_popup_coupons" v-show="popup_index==1"> <view class="order_popup_coupons" v-show="popup_index==1">
<view class="coupons_item" v-for="(item,index) in 3 " :key="index"> <view class="coupons_item" v-for="(item,index) in bonus_list " :key="item.bonus_id">
<view class="coupons_item_left"> <view class="coupons_item_left">
<view class="item_left_prcie">$20.00</view> <view class="item_left_prcie">${{item.type_money}}</view>
<text class="item_left_span">Min.spend</text> <text class="item_left_span">Min.spend</text>
<view>$200.00</view> <view>$200.00</view>
</view> </view>
<view class="coupons_item_right"> <view class="coupons_item_right">
<view class="coupons_right_info"> <view class="coupons_right_info">
<view class="coupons_right_info_title">All-purpose</view> <view class="coupons_right_info_title">{{item.type_name}}</view>
<text>The tide zone is available</text> <text>The tide zone is available</text>
<view class="coupons_right_info_time">2022.09.23 10:37 - 2022.12.23 10:37</view> <view class="coupons_right_info_time">2022.09.23 10:37 - 2022.12.23 10:37</view>
</view> </view>
<button>Use Now</button> <button @click="useCoupons(item.bonus_id)">Use Now</button>
<image src="../../static/img/select3.png" mode="" class="coupons_item_right_select"></image> <image src="../../static/img/select3.png" mode="" class="coupons_item_right_select" v-if="order.bonus==item.bonus_id"></image>
<image src="../../static/img/select.png" mode="" class="coupons_item_right_select" v-else></image>
</view> </view>
</view> </view>
</view> </view>
@ -223,7 +224,17 @@
} }
}, },
methods:{ methods:{
// 使
useCoupons(id){
let data={_action:'cartselectbonus',bonus:id,consignee:this.address}
defaultRequest3(data,'consignee').then(res=>{
console.info(res)
if(res.error==0){
this.total=res.data.total
this.order=res.data.order
}
})
},
// //
getPayDate(id,will_get_integral){ getPayDate(id,will_get_integral){
let data={_action:'payorder',order_id:id,order_type:'GOODSBUY',payment_method:'alipay.native'} let data={_action:'payorder',order_id:id,order_type:'GOODSBUY',payment_method:'alipay.native'}

10
pages/productDetails/index.vue

@ -172,7 +172,7 @@
</view> </view>
<view class="reviews"> <view class="reviews">
<view class="goods_title"> <view class="goods_title" @click="goReview">
<view class="goods_title_left"> <view class="goods_title_left">
<text>Reviews({{goodsDate.comment_summary[0].commentcount}})</text> <text>Reviews({{goodsDate.comment_summary[0].commentcount}})</text>
</view> </view>
@ -244,7 +244,7 @@
<view class="footer"> <view class="footer">
<view class="footer_left"> <view class="footer_left">
<text>US$314.00</text> <text>US${{goodsDate.is_promote==0? goodsDate.shop_price *cartQuery.goods_number:goodsDate.promote_price *cartQuery.goods_number}}</text>
</view> </view>
<view class="footer_right"> <view class="footer_right">
<button @click="isCart=true">ADD TO CART</button> <button @click="isCart=true">ADD TO CART</button>
@ -382,6 +382,12 @@
} }
}, },
methods:{ methods:{
//
goReview(){
uni.navigateTo({
url:'../account/myReview?goods_id='+this.query.goods_id
})
},
// //
addCart(){ addCart(){
if(this.goods_attr_list.length==0){ if(this.goods_attr_list.length==0){

Loading…
Cancel
Save