Authored by yyq

Merge branch 'develop' of git.yoho.cn:fe/yoho-brand-shop into develop

{
"navigationBarTitleText": "我的",
"enablePullDownRefresh": true,
"usingComponents": {
"copyright": "/components/layout/copyright/copyright",
"product-list": "/components/product/list",
... ...
... ... @@ -2,10 +2,10 @@
<view class="container">
<view class="my-page yoho-page">
<view class="my-header">
<image src="../../static/images/mine_bg@2x.png" class="header_bg"></image>
<view class="user-info">
<button wx:if="{{!isLogin}}" class="login-btn" bindtap="{{!hasUnionID ? 'loginRegTap' : ''}}"
open-type="{{hasUnionID ? 'getPhoneNumber' : ''}}" bindgetphonenumber="getPhoneNumber">登录/注册
<button wx:if="{{!isLogin}}" class="login-btn" bindtap="{{!hasUnionID ? 'loginRegTap' : ''}}"
plain="true"
open-type="{{hasUnionID ? 'getPhoneNumber' : ''}}" bindgetphonenumber="getPhoneNumber">登录
</button>
<block wx:else>
<image wx:if="{{userInfo.defaultAvatar}}" src="{{userInfo.avatarUrl}}"
... ... @@ -15,7 +15,6 @@
<image wx:if="{{userInfo.uid}}" class='vip-icon-image' src='{{vipImg}}'></image>
</block>
</view>
</view>
<view class="view-splite clearfix">
... ...
/**userCenter.wxss**/
.container {
border-top: 1rpx solid #eee;
}
.userinfo {
display: flex;
flex-direction: column;
... ... @@ -26,12 +29,10 @@ page {
display: flex;
position: relative;
color: #fff;
/* font-size: 0.85rem;
line-height: 4.5rem;
height: 5.5rem; */
font-size: 34rpx;
line-height: 180rpx;
height: 220rpx;
line-height: 200rpx;
height: 200rpx;
background-color: #fff;
}
.header_bg {
... ... @@ -48,16 +49,11 @@ page {
.my-page .user-info .user-avatar {
float: left;
position: absolute;
left: 32rpx;
top: 40rpx;
width:126rpx;
height: 126rpx;
border: 2rpx solid #a7a8a9;
/* left: .8rem;
top: 1.0rem;
width: 3.15rem;
height: 3.15rem;
border: .15rem solid #a7a8a9; */
left: 30rpx;
top: 50%;
width: 100rpx;
height: 100rpx;
margin-top: -50rpx;
background-size: 100%;
border-radius: 50%;
background: white;
... ... @@ -67,30 +63,29 @@ page {
position: absolute;
left: 138rpx;
float: left;
/* padding: 0 1.2rem;
padding-top: .2rem; */
padding: 0 48rpx;
padding-top: 8rpx;
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
max-width: 50%;
font-size: 38rpx;
font-weight: bold;
font-size: 32rpx;
font-family: PingFang-SC-Medium;
color: #222222;
letter-spacing: -0.39rpx;
padding-left: 34rpx;
}
.login-btn {
display: relative;
margin-left: auto;
margin-right: auto;
padding-bottom: 10rpx;
font-size: 35rpx;
font-size: 32rpx;
top: 35%;
width: 220rpx;
height: 80rpx;
line-height: 80rpx;
width: 180rpx;
height: 66rpx;
line-height: 64rpx;
text-align: center;
justify-content: center;
border-radius: 0;
border: 1rpx solid #e0e0e0!important;
outline: none;
color: #222222!important;
}
.my-page .my-order {
... ...
import wx from '../../../utils/wx';
import Yas from '../../../common/yas';
import orderHandle from './order-handle';
import commonModel from '../../../models/common';
import orderModel from '../../../models/home/order';
import formatImage from '../../../utils/formatImage';
... ... @@ -15,7 +16,8 @@ Page({
windowHeight: windowHeight + 48,
orderType: 1,
ordersList: [],
reason: []
reason: [],
orderCode: ''
},
onLoad: function (options) {
let type = options.type || 1;
... ... @@ -151,22 +153,28 @@ Page({
delOrder: function(e) {
const code = e.target.dataset.code;
orderHandle.deleteOrder(code, () => {
this.getOrders(this.data.orderType);
orderHandle.deleteOrder(code, res => {
if (res && res.code == 200) {
this.getOrders(this.data.orderType);
}
});
},
confirmReceive: function(e) {
let code = e.currentTarget.dataset.code;
orderHandle.confirmReceive(code, () => {
this.getOrders(this.data.orderType);
orderHandle.confirmReceive(code, res => {
if (res && res.code == 200) {
this.getOrders(this.data.orderType);
}
});
},
cancelOrder: function(e) {
let code = e.currentTarget.dataset.code;
orderHandle.cancelOrder(code, () => {
this.getOrders(this.data.orderType);
orderHandle.cancelOrder(code, res => {
if (res && res.code == 200) {
this.getOrders(this.data.orderType);
}
});
},
expressDetail: function(e){
... ... @@ -175,8 +183,8 @@ Page({
orderHandle.expressDetail(code);
},
payNow: function(e) {
let code = e.target.dataset.code;
let amount = e.target.dataset.amount;
let code = e.currentTarget.dataset.code;
let amount = e.currentTarget.dataset.amount;
orderHandle.payNow({ order_code: code, order_amount: amount});
},
... ... @@ -191,9 +199,11 @@ Page({
});
this.getOrders(type);
},
refundOrder() {
refundOrder(e) {
let that = this;
this.refundOrderCode = e.currentTarget.dataset.code;
wx.showModal({
content: '申请退款后,本单享有的优惠可能会一并取消,确定申请吗?',
cancelText: '取消',
... ... @@ -216,12 +226,22 @@ Page({
this.reasonIndex = e.detail.value[0];
},
reasonSure() {
orderHandle.refundNow(this.orderCode, this.data.reason[this.reasonIndex || 0], res => {
orderHandle.refundNow(this.refundOrderCode,
this.data.reason[this.reasonIndex || 0], res => {
if (res && res.code == 200) {
wx.navigateBack({delta:1});
this.getOrders(this.data.orderType);
}
});
this.setData({showReason: false});
},
submitFormId: function (e) {
//上报formID
commonModel.addWechatFormId({
order_code: e.detail.value.orderCode,
openId: app.getOpenID(),
miniapp_type: app.getMiniappType(),
formId: e.detail.formId
});
}
});
... ...
... ... @@ -134,62 +134,6 @@ image {
border: 0;
}
.order-page .order .footer {
text-align: right;
border-top: 1rpx solid #e0e0e0;
}
.order-page .order .sum-cost {
color: #e01;
margin-left: 4.5rpx;
display: inline-block;
}
.order-page .order .order-opt {
padding: 27rpx 0;
padding-right: 27rpx;
border-top: 1rpx solid #e0e0e0;
text-align: right;
margin-right: 20rpx;
display: flex;
flex-direction:row;
justify-content:flex-end;
}
.order-page .order .order-opt .counterView{
position: absolute;
left: 33rpx;
height: 108rpx;
bottom: 0rpx;
display: flex;
flex-direction:row;
align-items: center;
}
.order-page .order .order-opt .counterView .timeIcon{
height: 24rpx;
width: 24rpx;
}
.order-page .order .order-opt .counterView .counter{
margin-left: 10rpx;
font-size: 24rpx;
text-align: center;
}
.order-page .order .order-opt .btn {
display: inline-block;
box-sizing: border-box;
height: 54rpx;
line-height: 54rpx;
width: 126rpx;
font-size: 25rpx;
text-align: center;
border: 1px solid #444444;
border-radius: 10rpx;
color: #444444;
}
.button {
height: 54rpx;
line-height: 54rpx;
... ... @@ -207,15 +151,6 @@ a {
text-decoration: none;
}
.order-page .order .order-opt .pay {
background: #d0021b;
color: #fff;
border: none;
font-size: 25rpx;
margin-left: 20rpx;
line-height: 58rpx;
}
.loginBtn {
width: 65%;
height: 90rpx;
... ...
... ... @@ -53,31 +53,37 @@
</view>
</block>
<block wx:for="{{item.links}}" wx:for-item="link" wx:key="order_code">
<block wx:if="{{link == 'closeOrder'}}">
<view class="btn" formType="submit" type="default" size="{{defaultSize}}" plain='true'
catchtap="cancelOrder" data-code="{{item.order_code}}">取消订单</view>
</block>
<block wx:if="{{link == 'buyNow'}}">
<view class="btn pay" catchtap="payNow" data-code="{{item.order_code}}"
data-amount="{{item.amount}}">立即付款
</view>
</block>
<block wx:if="{{link == 'delOrder'}}">
<view class="btn cancel" catchtap="delOrder" data-code="{{item.order_code}}">删除订单</view>
</block>
<block wx:if="{{link == 'getExpress'}}">
<view class="btn cancel" catchtap="expressDetail" data-code="{{item.order_code}}">查看物流</view>
</block>
<block wx:if="{{link == 'confirm'}}">
<view class="button pay" catchtap="confirmReceive" data-code="{{item.order_code}}">确认收货
</view>
</block>
<block wx:if="{{link == 'refundApply'}}">
<view class="button cancel" catchtap="refundOrder" data-code="{{item.order_code}}">申请退款
</view>
<form bindsubmit="submitFormId" report-submit='true'>
<block wx:for="{{item.links}}" wx:for-item="link" wx:key="order_code">
<block wx:if="{{link == 'closeOrder'}}">
<button class="btn cancel" formType="submit" catchtap="cancelOrder"
plain="true" data-code="{{item.order_code}}">取消订单</button>
</block>
<block wx:if="{{link == 'buyNow'}}">
<view class="btn pay" catchtap="payNow" data-code="{{item.order_code}}"
data-amount="{{item.amount}}">立即付款
</view>
</block>
<block wx:if="{{link == 'delOrder'}}">
<view class="btn cancel" catchtap="delOrder" data-code="{{item.order_code}}">删除订单</view>
</block>
<block wx:if="{{link == 'getExpress'}}">
<view class="btn cancel" catchtap="expressDetail" data-code="{{item.order_code}}">查看物流</view>
</block>
<block wx:if="{{link == 'confirm'}}">
<button class="button pay confirm" formType="submit" catchtap="confirmReceive" data-code="{{item.order_code}}">确认收货</button>
</block>
<block wx:if="{{link == 'refundApply'}}">
<button class="button refund" formType="submit" plain='true' catchtap="refundApply" plain="true" data-code="{{item.order_code}}">申请退款</button>
</block>
<block wx:if="{{link == 'refundApply'}}">
<view class="button cancel" catchtap="refundOrder" data-code="{{item.order_code}}">申请退款
</view>
</block>
</block>
</block>
<input type="text" name="orderCode" class="hide-code" value="{{item.order_code}}"/>
</form>
</view>
</view>
</template>
... ...
... ... @@ -163,7 +163,8 @@ image {
}
.order .order-opt {
padding: 27rpx 0;
position: relative;
height: 100rpx;
padding-right: 27rpx;
border-top: 1rpx solid #e0e0e0;
text-align: right;
... ... @@ -171,16 +172,21 @@ image {
display: flex;
flex-direction:row;
justify-content:flex-end;
padding-top: 20rpx;
box-sizing: border-box;
overflow: hidden;
}
.order .order-opt .counterView{
position: absolute;
left: 33rpx;
height: 108rpx;
top: 20rpx;
height: 60rpx;
bottom: 0rpx;
display: flex;
flex-direction:row;
align-items: center;
box-sizing: border-box;
}
.order .order-opt .counterView .timeIcon{
... ... @@ -204,6 +210,14 @@ image {
border: 1rpx solid #444444;
color: #444444;
border-radius: 4rpx;
box-sizing: border-box;
vertical-align: middle;
}
.order .order-opt .hide-code {
opacity: 0;
margin-top: 100rpx;
font-size: 0;
}
.button {
... ... @@ -231,4 +245,12 @@ a {
margin-left: 20rpx;
line-height: 58rpx;
border: 1rpx solid #d0021b;
}
\ No newline at end of file
}
.btn.cancel,
.btn.refund,
.btn.confirm {
box-sizing: content-box;
padding: 0;
margin: 0;
}
... ...
... ... @@ -42,7 +42,7 @@ Page({
resetListScrollPos: res[0].top - (res[1].bottom - res[1].top)
});
})
}, 1000);
}, 2000);
yas.pageOpenReport();
},
... ...
... ... @@ -307,27 +307,28 @@ Page({
marketPrice: res.data.format_market_price,
salesPrice: res.data.format_sales_price,
productImages: ImgUrls,
pickerData: pickData,
storage_sum: res.data.storage_sum,
snapshootShareData: snapData,
shopId: res.data.shop_id
// 暂时没用
// brand_id: res.data.brand_id,
// isLimitBuy:res.data.isLimitBuy,
// is_deposit_advance:res.data.is_deposit_advance,
// is_secKill:res.data.is_secKill,
// is_advance:res.data.is_advance,
// sales_phrase: res.data.sales_phrase,
// expect_arrival_time: res.data.expect_arrival_time,
// expect_arrival_time: res.data.expect_arrival_time || '',
// isInstalment:res.data.isInstalment,
pickerData: pickData,
// product_id: res.data.product_id,
// vipPrice : res.data.vip,
storage_sum: res.data.storage_sum,
// vipPrice : res.data.vip || '',
// is_supplyed: res.data.is_supplyed,
// bundle_type: res.data.bundle_type,
// store_show_status: res.data.store_show_status,
snapshootShareData: snapData,
// attribute: res.data.attribute,
// productOnlyProvideByYohoAPP: res.data.is_secKill === 'Y' || res.data.is_advance === 'Y' || res.data.attribute === 3 || res.data.attribute === 4 || res.data.isLimitBuy || res.data.is_deposit_advance==='Y',
// productOnlyProvideByYohoStore: res.data.store_show_status === 3 || res.data.store_show_status === 4,
// productNotForSale: res.data.attribute===2,
shopId: res.data.shop_id
// brand_id: res.data.brand_id
});
this.shopRecList(res.data.shop_id);
... ... @@ -381,9 +382,9 @@ Page({
});
},
buyImmediate: function () {
// if (this.data.productOnlyProvideByYohoAPP || this.data.productOnlyProvideByYohoStore || this.data.productNotForSale) {
// return;
// }
if (this.data.productOnlyProvideByYohoAPP || this.data.productOnlyProvideByYohoStore || this.data.productNotForSale) {
return;
}
if (this.data.storage_sum === 0) return;
this.setData({buyImmediate: true});
... ...
... ... @@ -93,7 +93,7 @@
<view class='titleLine'></view>
<view class='titleDesc'> 店铺推荐商品</view>
</view>
<view class="product-list">
<view class="product-list shop-rec">
<product-list list="{{shopRecList}}"></product-list>
</view>
</block>
... ... @@ -103,7 +103,7 @@
<view class='titleLine'></view>
<view class='titleDesc'> 你可能喜欢</view>
</view>
<view class="product-list">
<view class="product-list prefer">
<product-list list="{{preferList}}"></product-list>
</view>
</block>
... ...
... ... @@ -815,3 +815,13 @@
.goodsInfo.img {
font-size: 0;
}
.product-list.shop-rec {
padding-bottom: 60rpx;
}
.product-list.prefer {
padding-bottom: 60rpx;
}
\ No newline at end of file
... ...