Authored by 李奇

Merge branch 'release/6.8.5' into 'master'

Release/6.8.5



See merge request !7
Showing 48 changed files with 895 additions and 311 deletions
... ... @@ -53,7 +53,6 @@
"babel-preset-env": "^1.6.1",
"eslint": "^4.19.1",
"eslint-config-taro": "^1.1.0",
"eslint-plugin-import": "^2.12.0",
"eslint-plugin-react": "^7.8.2",
"eslint-plugin-taro": "^1.1.0",
"node-sass": "^4.9.3",
... ...
... ... @@ -33,12 +33,6 @@
"current": 12,
"list": [
{
"id": 0,
"name": "商品详情",
"pathName": "pages/productDetail/index",
"query": "id= 10000022"
},
{
"id": -1,
"name": "搜索",
"pathName": "pages/search/index",
... ... @@ -103,6 +97,26 @@
"name": "地址管理",
"pathName": "pages/userCenter/addressManager/addressManager",
"query": ""
},
{
"id": -1,
"name": "商品详情线上",
"pathName": "pages/productDetail/index",
"query": "id=10000070"
},
{
"id": 12,
"name": "商品详情线下店",
"pathName": "pages/productDetail/index",
"query": "q=https%3a%2f%2fo.yohobuy.com%2fufo%3fp%3d167215%2c1%26skup%3d167215%26skn%3d10001240",
"scene": "1011"
},
{
"id": -1,
"name": "支付完成",
"pathName": "pages/order/orderSuccess/orderSuccess",
"query": "",
"scene": "1011"
}
]
}
... ...
... ... @@ -78,6 +78,11 @@ class App extends Component {
"pages/zeroSell/snapshootShare",
"pages/zeroSell/h5Page"
],
"permission": {
"scope.userLocation": {
"desc": "你的位置信息将用于小程序位置接口的效果展示"
}
},
window: {
backgroundTextStyle: 'light',
navigationBarBackgroundColor: '#fff',
... ...
import api from './checkstoreService';
import event from '../../utils/event.js'
const storeApi = new api();
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
properties: {
// 弹窗标题
storeId: { // 属性名
type: Number, // 类型(必填),目前接受的类型包括:String, Number, Boolean, Object, Array, null(表示任意类型)
value: 0 // 属性初始值(可选),如果未指定则会根据类型选择一个
},
productId: {
type: Number,
value: 0
}
},
data: {
// 弹窗显示控制
content: "Sorry,您的位置不在门店范围内,不能选择门店自提方式购买该商品",
cancelText: "线上购买",
confirmText: "知道了",
type: 0
},
/**
* 组件的方法列表
* 更新属性和数据的方法与更新页面数据的方法类似
*/
methods: {
init() {
return new Promise((resolve) => {
let param = {};
this.dialog = this.selectComponent("#dialog");
wx.getLocation({
success: (res) => {
param.user_latitude = res.latitude;
param.user_longitude = res.longitude;
param.store_id = this.properties.storeId;
storeApi.checkStore(param, () => {
wx.hideLoading();
}).then(r => {
if (!r.isInRange) {
this.setData({
// 弹窗显示控制
content: "Sorry,您的位置不在门店范围内,不能选择门店自提方式购买该商品",
cancelText: "线上购买",
confirmText: "知道了",
type: 0
});
this.dialog.showDialog();
resolve({result: false})
} else {
resolve({
result: true,
data: param
})
}
});
},
fail: () => {
this.setData({
type: 1,
content: "请确保手机打开定位,并允许微信获取您的位置信息",
cancelText: "取消",
confirmText: "去开启",
})
this.dialog.showDialog();
resolve({result: false})
}
});
})
},
cancelEvent() {
if (this.data.type) {
this.dialog.hideDialog();
} else {
wx.navigateTo({url: '/pages/productDetail/index?id=' + this.properties.productId})
}
},
confirmEvent() {
if (this.data.type) {
wx.openSetting({
complete: () => {
this.dialog.hideDialog();
}
});
} else {
this.dialog.hideDialog();
}
}
}
})
... ...
{
"component": true,
"usingComponents": {
"dialog": "../../components/dialog/dialog"
}
}
... ...
<dialog id="dialog" content="{{content}}" confirmText="{{confirmText}}" cancelText="{{cancelText}}"
bind:confirmEvent="confirmEvent" bind:cancelEvent="cancelEvent"></dialog>
... ...
import BaseService from '../../libs/services/baseService.js';
const UFO_CHECK_STORE = 'ufo.store.isLocationInStore';
export default class checkstoreService extends BaseService {
async checkStore(params, complete) {
return await this.GET(
{
...params,
method: UFO_CHECK_STORE
},
{
complete
}
).then((data) => {
return data;
}).catch((error) => {
return error;
})
}
}
... ...
... ... @@ -65,12 +65,10 @@ Component({
* triggerEvent 用于触发事件
*/
_cancelEvent() {
//触发取消回调
this.triggerEvent("cancelEvent")
},
_confirmEvent() {
//触发成功回调
this.triggerEvent("confirmEvent");
}
}
})
\ No newline at end of file
})
... ...
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
"usingComponents": {
}
}
... ...
<!--src/components/dialog/dialog.wxml-->
<view class='wx_dialog_container' hidden="{{!isShow}}">
<view class='wx-mask'></view>
<view class='wx-dialog'>
<view class='wx-dialog-title'>{{ title }}</view>
<view class='wx-dialog-content'>{{ content }}</view>
<view class='wx-dialog-footer'>
<view class='wx-dialog-btn' catchtap='_cancelEvent'>{{ cancelText }}</view>
<view class='wx-dialog-btn' catchtap='_confirmEvent'>{{ confirmText }}</view>
</view>
<view class='wx-mask'></view>
<view class='wx-dialog'>
<view class='wx-dialog-content'>{{ content }}</view>
<view class='wx-dialog-footer'>
<view class='wx-dialog-btn' bindtap="_cancelEvent">{{ cancelText }}</view>
<view class='wx-dialog-btn' bindtap="_confirmEvent">{{ confirmText }}</view>
</view>
</view>
</view>
... ...
/* src/components/dialog/dialog.wxss */
.wx-mask{
position: fixed;
z-index: 1000;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
position: fixed;
z-index: 1000;
top: 0;
right: 0;
left: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
}
.wx-dialog{
position: fixed;
z-index: 5000;
width: 80%;
max-width: 600rpx;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #FFFFFF;
text-align: center;
border-radius: 3px;
overflow: hidden;
position: fixed;
z-index: 5000;
width: 560rpx;
top: 50%;
left: 50%;
-webkit-transform: translate(-50%, -50%);
transform: translate(-50%, -50%);
background-color: #FFFFFF;
text-align: center;
border-radius: 3rpx;
overflow: hidden;
}
.wx-dialog-title{
font-size: 18px;
padding: 15px 15px 5px;
font-size: 30rpx;
padding: 15rpx 15rpx 5rpx;
}
.wx-dialog-content{
padding: 15px 15px 5px;
min-height: 40px;
font-size: 16px;
line-height: 1.3;
word-wrap: break-word;
word-break: break-all;
color: #999999;
height: 240rpx;
font-size: 30rpx;
display:flex;
align-items:center;/*垂直居中*/
justify-content: center;/*水平居中*/
margin: 0 50rpx;
}
.wx-dialog-footer{
display: flex;
align-items: center;
position: relative;
line-height: 45px;
font-size: 17px;
display: flex;
align-items: center;
position: relative;
height: 100rpx;
font-size: 30rpx;
}
.wx-dialog-footer::before{
content: '';
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #D5D5D6;
color: #D5D5D6;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
content: '';
position: absolute;
left: 0;
top: 0;
right: 0;
height: 1px;
border-top: 1rpx solid #D5D5D6;
color: #D5D5D6;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleY(0.5);
transform: scaleY(0.5);
}
.wx-dialog-btn{
display: block;
-webkit-flex: 1;
flex: 1;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
position: relative;
display: block;
-webkit-flex: 1;
flex: 1;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
position: relative;
height:100%;
line-height:100rpx;
}
.wx-dialog-footer .wx-dialog-btn:nth-of-type(1){
color: #353535;
color: #999;
}
.wx-dialog-footer .wx-dialog-btn:nth-of-type(2){
color: #3CC51F;
color: #000;
}
.wx-dialog-footer .wx-dialog-btn:nth-of-type(2):after{
content: " ";
position: absolute;
left: 0;
top: 0;
width: 1px;
bottom: 0;
border-left: 2rpx solid #D5D5D6;
color: #D5D5D6;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleX(0.5);
transform: scaleX(0.5);
}
\ No newline at end of file
content: " ";
position: absolute;
left: 0;
top: 0;
width: 1rpx;
bottom: 0;
border-left: 2rpx solid #D5D5D6;
color: #D5D5D6;
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
-webkit-transform: scaleX(0.5);
transform: scaleX(0.5);
}
... ...
... ... @@ -16,7 +16,7 @@ let FROM_WHERE = 0;
/**
* 订单操作
*/
// export const
// export const
function actionOrder (orderCode, method) {
let that = this;
wx.showLoading({
... ... @@ -41,8 +41,8 @@ function actionOrder (orderCode, method) {
})
}
event.emit('refresh-order');
});
}
/**
... ... @@ -58,7 +58,7 @@ export const showDialog = function (orderCode, actionType, fromWhere) {
content = '您确定删除订单?';
method = UFO_BUYER_DELETE_ORDER;
} else if (actionType == CANCEL_ORDER) {
content = '您确定取消订单?';
content = '您确定不买此商品吗?';
method = UFO_BUYER_CANCEL_ORDER;
} else if (actionType == CONFIRM_DELIVERY) {
... ... @@ -70,9 +70,9 @@ export const showDialog = function (orderCode, actionType, fromWhere) {
// title: title,
content: content,
showCancel: true,
cancelText: "确定",
cancelText:actionType == CANCEL_ORDER?'取消订单':"确定",
cancelColor: '#E0E0E0',
confirmText: "取消",
confirmText: actionType == CANCEL_ORDER?"保留订单":"取消",
confirmColor: '#000000',
success: function (res) {
if (res.cancel) {
... ... @@ -85,4 +85,4 @@ export const showDialog = function (orderCode, actionType, fromWhere) {
complete: function (res) { },
})
}
\ No newline at end of file
}
... ...
... ... @@ -7,7 +7,9 @@ const BUY_AGAIN = 'buy_again';
const NOW_BUY = 'now_buy';
const SHOW_DETAIL = 'show_detail';
const SHOW_EXPRESS = 'show_express';
import event from '../../utils/event';
let interval;
Component({
/**
... ... @@ -21,6 +23,10 @@ Component({
realPrice: String,
orderCode:String,
productId:String,
isStore:{
type:Boolean,
value: false
}
},
/**
... ... @@ -33,7 +39,7 @@ Component({
},
lifetimes: {
},
attached: function () {
... ... @@ -44,37 +50,39 @@ attached: function () {
console.log("lastIndex===" + lastIndex);
that.setData({ lastIndex: lastIndex });
}
if (that.data.timer) {
let leftTime = that.data.lefttime;
let timer = that.data.timer;
if(timer > 0){
let interval = setInterval(() => {
timer = timer - 1;
leftTime = formatTimeByMin(timer, 'm:s');
if (timer > 0){
interval = setInterval(() => {
timer = timer - 1;
leftTime = formatTimeByMin(timer, 'm:s');
if (timer <= 0) {
leftTime = '00:00'
leftTime = '00:00';
setTimeout(() => {
event.emit('refresh-order');
}, 2000);
clearInterval(interval);
}
that.setData({
lefttime: leftTime,
timer: timer
});
}, 1000);
that.setData({ interval: interval});
}
}
},
detached: function () {
let interval = this.interval;
if (interval){
clearInterval(interval);
}
},
/**
* 组件的方法列表
... ... @@ -85,15 +93,14 @@ detached: function () {
let actionCode = e.currentTarget.dataset.buttonCode;
let orderCode = e.currentTarget.dataset.orderCode;
let productId = e.currentTarget.dataset.productId;
if (actionCode == BUY_AGAIN) {
let params = {
id: productId
}
router.go('productDetail', params);
} else if (actionCode == NOW_BUY){
console.log("== 去支付页面===")
prePay(productId, orderCode, 1);
prePay(productId, orderCode, 1 ,this.properties.isStore);
} else if (actionCode == SHOW_DETAIL) {
let params = {
orderCode
... ... @@ -107,9 +114,9 @@ detached: function () {
} else {
showDialog(orderCode, actionCode, 0);
}
},
}
... ...
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
}
... ...
... ... @@ -10,10 +10,10 @@
<text class='order-daction-pay-amount-title-txt'>{{lefttime}}</text>
</view>
</view>
<view class='order-action-bottom-button-view'>
<block wx:for="{{buttons}}" wx:key="{{index}}">
<button class='{{index == lastIndex ? "order-action-selected-button":"order-action-unselected-button"}}' catchtap='onButtonClick' data-button-code='{{item.code}}' data-order-code='{{orderCode}}' data-product-id='{{productId}}'>{{item.text}}</button>
</block>
</block>
</view>
</view>
... ...
// src/components/order/orderproductinfo.js
Component({
/**
* 组件的属性列表
*/
... ... @@ -8,6 +8,10 @@ Component({
productInfo: Object,
statuStr:String,
fromPage: Number,
isStore:{
type:Boolean,
value: false
}
},
/**
... ...
... ... @@ -9,6 +9,8 @@
</view>
<text class='component-order-product-name-txt'>{{productInfo.productName}}</text>
</view>
<text class='component-order-size-color-txt'>{{productInfo.colorName}},{{productInfo.sizeName}}</text>
<text class='component-order-size-color-txt' wx:if="{{isStore}}">{{productInfo.colorName}},{{productInfo.sizeName}},{{productInfo.skup}}</text>
<text class='component-order-size-color-txt' wx:else>{{productInfo.colorName}},{{productInfo.sizeName}}</text>
</view>
</view>
... ...
... ... @@ -36,7 +36,7 @@ export default class SelectSize extends Component {
curSelect: item.size_id,
selectedskup: item.skup,
curPrice: item.least_price,
canBuy: item.storage_num > 0
canBuy: item.skup > 0
});
}
... ... @@ -96,7 +96,7 @@ export default class SelectSize extends Component {
{
sizeList.map((item, index) => {
let price;
if (item.storage_num > 0) {
if (item.skup > 0) {
price = ${item.least_price}`;
} else {
price = '-';
... ...
... ... @@ -49,7 +49,9 @@ const getPrivateKey = () => {
if (data && data.data && data.data.sk) {
// 存在,获取,存储并返回
p2SecretKey = data.data.sk;
globalData.p2SecretKey = p2SecretKey;
if (globalData) {
globalData.p2SecretKey = p2SecretKey;
}
wx.setStorageSync("p2SecretKey", p2SecretKey);
wx.setStorageSync("verifyKey", p2SecretKey);
resolve(p2SecretKey);
... ...
... ... @@ -50,5 +50,14 @@ export default {
productId
}
})
},
getStoreProductDetail(skup, store_id) {
return api.get({
data: {
method: 'ufo.product.skup.detail',
skup,
store_id
}
})
}
}
\ No newline at end of file
... ...
... ... @@ -14,6 +14,10 @@ Component({
damagesDesc: {
type: String,
value:''
},
isStore:{
type:Boolean,
value:false
}
},
data: {//组件内部数据
... ...
... ... @@ -3,7 +3,7 @@
<text class="priceLeft">{{item.promotion}}:</text>
<text class="{{item.promotion=='实付金额' ? 'priceRightTwo': 'priceRight'}}">{{item.promotionAmount}}</text>
</view>
<view>
<text class="priceInfo">{{damagesDesc}}</text>
<view class="priceInfo {{!isStore || 'des-store'}}">
{{damagesDesc}}
</view>
</view>
... ...
... ... @@ -42,6 +42,8 @@
font-family: PingFang-SC-Regular;
font-size: 24rpx;
color: #999999;
letter-spacing: 0;
}
.des-store{
background: #F0F0F0;
padding:20rpx;
}
... ...
... ... @@ -12,6 +12,10 @@ Component({
value: {
}
},
isStore: {
type:Boolean,
value: false
}
},
data: {//组件内部数据
... ...
... ... @@ -5,6 +5,7 @@
<view class="productRightContainer">
<text class="productPrice">¥{{productInfo.goodPrice}}</text>
<text class="productName">{{productInfo.productName}}</text>
<text class="productColor">{{productInfo.colorName + ',' + productInfo.sizeName}}</text>
<text class="productColor" wx:if="{{isStore}}">{{productInfo.colorName + ',' + productInfo.sizeName + ',' +productInfo.skup}}</text>
<text class="productColor" wx:else>{{productInfo.colorName + ',' + productInfo.sizeName}}</text>
</view>
</view>
... ...
/**
* addressCell.js
*@author dennis
*@createtime 2018/10/26
*@description 地址选择及展示
*/
Component({
properties: {//属性值可以在组件使用时指定
storeName: {
type:String,
value: ''
},
storeAddress: {
type: String,
value: ''
}
},
data: {//组件内部数据
addressIcon: '../../../../assets/images/noad@2x.png',
}
})
... ...
<view class='line'></view>
<view class="addressHasItem">
<view class="addressHasIconContainer">
<image class="addressHasIcon" src="{{addressIcon}}" mode='aspectFill'></image>
</view>
<view class="addressRightContainer">
<text class="addressUserName">提货地址:{{storeName}}</text>
<text class="addressUserAddress">{{storeAddress}}</text>
</view>
</view>
... ...
.line {
background-color: #EEEEEE;
height: 2rpx;
margin-top: 20rpx;
}
.addressIcon {
width: 40rpx;
height: 40rpx;
}
.addressNoText {
font-size:40rpx;
font-family: PingFang-SC-Medium;
font-weight: 500;
color: #000000;
margin-left: 10rpx;
}
.addressNoItem {
display: flex;
align-items: center;
justify-content: center;
margin-top: 60px;
margin-bottom: 80px;
}
.addressHasIconContainer {
width: 40rpx;
display: flex;
align-items: center;
justify-content: center;
margin-right: 40rpx;
}
.addressHasIcon {
width: 48rpx;
height: 48rpx;
}
.addressUserName {
margin-top: 35rpx;
font-family: DINAlternate-Bold;
font-size: 32rpx;
color: #000000;
letter-spacing: 0;
display: block;
font-weight: bolder;
}
.addressUserAddress {
margin-top: 12rpx;
font-family: PingFang-SC-Regular;
font-size: 24rpx;
color: #999999;
letter-spacing: 0;
display: block;
}
.bottom-view {
display: flex;
justify-content: space-between;
}
.addressUserPhone {
margin-top: 12rpx;
margin-bottom: 30rpx;
font-family: SFProText-Medium;
font-size: 28rpx;
color: #000000;
letter-spacing: 0;
display: block;
}
.change-address {
display: flex;
align-items: center;
}
.change-address-tips {
font-family: PingFang-SC-Regular;
font-size: 22rpx;
color: #222222;
letter-spacing: 0.31px;
text-align: right;
}
.change-address-icon {
width: 30rpx;
height: 30rpx;
}
.addressRightContainer {
/* overflow: auto; */
width: 582rpx;
}
.addressHasItem {
overflow: hidden;
display: flex;
flex-direction: row;
margin-bottom: 42rpx;
}
... ...
... ... @@ -13,6 +13,7 @@ import Yas from '../../../utils/yas';
let yas;
const api = new orderService();
Page({
data: {
... ... @@ -23,57 +24,62 @@ Page({
agreeProtocol: false,
checkImage: '../../../assets/images/select@2x.png',
unCheckImage: '../../../assets/images/unselect@2x.png',
isStore: 0,
storeId: 0
},
onLoad: function (option) {
onLoad: async function (option) {
yas = new Yas(this);
yas.pageOpenReport();
this.setData({
skup: option && option.skup ? option.skup : '',
product_id: option && option.product_id ? option.product_id : '',
isStore: Number(option.is_store) || 0,
storeId: option.store_id || 0,
skup: option.skup || '',
product_id: option.product_id || '',
hasAddress: false
})
this.fetchData()
this.fetchAddress()
},
onShow() {
await this.fetchData(option.is_store);
if (!option.is_store) {
await this.fetchAddress()
}
},
fetchData() {
let api = new orderService();
async fetchData(isStore) {
wx.showLoading({
title: '',
});
let params = {
skup: this.data.skup,
store_id: this.data.storeId
}
api.createPaymentInfo(params, () => wx.hideLoading())
.then(data => {
if (data) {
if (data.good && data.good.goodImg) {
data.good.goodImg = getImgUrl(data.good.goodImg,270,270)
}
this.setData(data)
let data;
if (isStore) {
data = await api.createOfflinePayment(params, () => wx.hideLoading())
let index;
data.promotionFormulaList.forEach((value, i) => {
if (value.promotion === '运费') {
index = i;
}
})
.catch(error => {
console.log(error)
})
data.promotionFormulaList.splice(index,1)
} else {
data = await api.createPaymentInfo(params, () => wx.hideLoading())
}
if (data.good && data.good.goodImg) {
data.good.goodImg = getImgUrl(data.good.goodImg, 270, 270)
}
this.setData(data)
},
fetchAddress() {
let api = new orderService().yohoApi()
async fetchAddress() {
wx.showLoading({
title: '',
})
let params = {
}
let params = {}
api.buyerGetAddress(params, () => wx.hideLoading())
await api.yohoApi().buyerGetAddress(params, () => wx.hideLoading())
.then(data => {
if (Array.isArray(data)){
if (Array.isArray(data)) {
for (let item of data) {
let index = data.indexOf(item)
if (item.is_default === 'Y') {
... ... @@ -83,7 +89,7 @@ Page({
})
break
}
if (index == data.length - 1){
if (index == data.length - 1) {
this.setData({
address: item,
hasAddress: true,
... ... @@ -96,53 +102,65 @@ Page({
.catch(error => {
console.log(error)
})
api.defaultApi();
},
submit() {
if (!this.data.agreeProtocol) return
if (!this.data.hasAddress) {
wx.showToast({
title:'请选择地址'
})
return
}
async submit() {
if (!this.data.agreeProtocol) return;
let data;
try {
if (this.data.isStore) {
this.check = this.selectComponent("#check");
let checkRes = await this.check.init();
if (!checkRes.result) return;
let param = checkRes.data;
param.skup = this.data.skup
wx.showLoading({
title: '',
})
data = await api.storeBuyerSubmit(param, () => {
wx.hideLoading()
})
let addressId = this.data.hasAddress && this.data.address && this.data.address.address_id
let skup = this.data.skup
let channelNo = ''
} else {
if (!this.data.hasAddress) {
wx.showToast({
title: '请选择地址'
})
return
}
let api = new orderService()
wx.showLoading({
title: '',
})
let addressId = this.data.hasAddress && this.data.address && this.data.address.address_id
let skup = this.data.skup
let channelNo = '';
api.buyerSubmit(skup,channelNo,addressId, () => wx.hideLoading())
.then(data => {
if (data && data.orderCode) {
let orderCode = data.orderCode;
let productId = data.productId ? data.productId : '';
let params = {
RPD_SKUP: skup,
ORD_NUM: orderCode + ''
};
yas.report('YB_SC_ORD', params);
prePay(productId, orderCode, 0);
}
})
.catch(error => {
wx.showToast({
title: error.message,
icon: 'none'
wx.showLoading({
title: '',
})
data = await api.buyerSubmit(skup, channelNo, addressId, () => wx.hideLoading());
}
if (data && data.orderCode) {
let skup = this.data.skup
let orderCode = data.orderCode;
let productId = data.productId ? data.productId : '';
let params = {
RPD_SKUP: skup,
ORD_NUM: orderCode + ''
};
yas.report('YB_SC_ORD', params);
prePay(productId, orderCode, 0, this.data.isStore > 0);
}
} catch (error) {
wx.showToast({
title: error.message,
icon: 'none'
})
}
},
chooseAddress: function(){
chooseAddress: function () {
let addressId = this.data.address ? this.data.address.address_id : ''
let params = {
currentMode: 'modeSelect',
... ... @@ -151,7 +169,7 @@ Page({
router.go('addressManager', params);
},
selectComplete: function(data) {
selectComplete: function (data) {
if (data) {
this.setData({
... ...
... ... @@ -5,6 +5,8 @@
"addressCell": "./components/addressCell",
"productCell": "./components/productCell",
"priceCell": "./components/priceCell",
"payDeliveryCell": "./components/payDeliveryCell"
"payDeliveryCell": "./components/payDeliveryCell",
"storeAddress":"./components/storeAddress",
"checkstore":"../../../components/checkstore/checkstore"
}
}
... ...
<!-- <view> -->
<!-- <view class="orderContainer"> -->
<scroll-view scroll-y class="orderContainer">
<text class='message-title'>确认订单</text>
<addressCell hasAddress="{{hasAddress}}" address="{{address}}" bindaddressevent="chooseAddress"></addressCell>
<productCell productInfo="{{good}}"></productCell>
<priceCell promotionFormulaList="{{promotionFormulaList}}" damagesDesc="{{damagesDesc}}"></priceCell>
<payDeliveryCell paymentWay="{{paymentWay}}" deliveryWay="{{deliveryWay}}"></payDeliveryCell>
</scroll-view>
<scroll-view scroll-y class="orderContainer">
<text class='message-title'>确认订单</text>
<addressCell hasAddress="{{hasAddress}}" address="{{address}}" bindaddressevent="chooseAddress"
wx:if="{{!isStore}}"></addressCell>
<storeAddress storeName="{{storeName}}" storeAddress="{{storeAddress}}" bindaddressevent="chooseAddress"
wx:else></storeAddress>
<productCell productInfo="{{good}}" isStore="{{isStore === 1}}"></productCell>
<priceCell promotionFormulaList="{{promotionFormulaList}}" damagesDesc="{{damagesDesc}}" isStore="{{isStore === 1}}"></priceCell>
<payDeliveryCell paymentWay="{{paymentWay}}" deliveryWay="{{deliveryWay}}"></payDeliveryCell>
</scroll-view>
<!-- </view> -->
<view class='pay-bottom-root'>
<view class="payProtocolContainer">
<view class="payProtocol">
<view class="payProtocolCheckImageContainer" bindtap="checkProtocol">
<image class="payProtocolCheckImage" src="{{agreeProtocol ? checkImage : unCheckImage}}"></image>
</view>
<text class="payProtocolLabel">{{protocolLabel}}</text>
<view class="protocolTextContainer" bindtap="goProtocol">
<text class="payProtocolText">{{protocolText}}</text>
<view class="payProtocolContainer">
<view class="payProtocol">
<view class="payProtocolCheckImageContainer" bindtap="checkProtocol">
<image class="payProtocolCheckImage" src="{{agreeProtocol ? checkImage : unCheckImage}}"></image>
</view>
<text class="payProtocolLabel">{{protocolLabel}}</text>
<view class="protocolTextContainer" bindtap="goProtocol">
<text class="payProtocolText">{{protocolText}}</text>
</view>
</view>
</view>
</view>
</view>
<view class="payBottomContainer">
<view class="payBottomLeft">
<view class="payBottomLeftItem">
<text class="payLabel">{{payLabel}}</text>
<text class="payAmount">¥{{amount}}</text>
<view class="payBottomContainer">
<view class="payBottomLeft">
<view class="payBottomLeftItem">
<text class="payLabel">{{payLabel}}</text>
<text class="payAmount">¥{{amount}}</text>
</view>
</view>
<view class="{{agreeProtocol ? 'payBottomRight' : 'payBottomRightUnCheck'}}" bindtap="submit">
<text class="payButton">{{payButton}}</text>
</view>
</view>
</view>
<view class="{{agreeProtocol ? 'payBottomRight' : 'payBottomRightUnCheck'}}" bindtap="submit">
<text class="payButton">{{payButton}}</text>
</view>
</view>
</view>
<checkstore id="check" storeId="{{storeId}}" productId="{{product_id}}"></checkstore>
... ...
... ... @@ -13,7 +13,8 @@ const BUYER_SUBMIT = 'ufo.order.submit'
const BUYER_PREPAY = 'ufo.order.pay'
const COMPUTE_COMPENSATE = 'ufo.buyer.computeCompensate'
const PRODUCT_RECOMMEND = 'ufo.product.data.search.recommend'
const CREATE_OFFLINE_PAYMENTINFO = 'ufo.order.offlinePayment';
const STORE_BUYER_SUBMIT = 'ufo.order.offlineSubmit'
export default class orderService extends BaseService {
constructor(options) {
super(options)
... ... @@ -32,37 +33,57 @@ export default class orderService extends BaseService {
)
}
async createOfflinePayment(params, complete) {
return await this.GET({
...params,
method: CREATE_OFFLINE_PAYMENTINFO
}, {
path: '/shopping',
complete
})
}
async buyerGetAddress(params, complete) {
return await this.GET({
...params,
method:BUYER_GETADDRESS
},{
method: BUYER_GETADDRESS
}, {
complete
})
}
async buyerSubmit(skup,channelNo='2919',addressId, complete) {
async buyerSubmit(skup, channelNo = '2919', addressId, complete) {
return await this.GET({
method: BUYER_SUBMIT,
skup,
channelNo,
addressId,
},{
}, {
path: '/shopping',
complete
})
}
async storeBuyerSubmit(params,complete){
return await this.GET({
method: STORE_BUYER_SUBMIT,
...params
}, {
path: '/shopping',
complete
})
}
async prePay( orderCode, openId, complete) {
async prePay(orderCode, openId, complete) {
return await this.GET({
orderCode,
openid: openId,
payment: 3,
method:BUYER_PREPAY,
},{
method: BUYER_PREPAY,
}, {
path: '/payment',
complete
})
... ... @@ -72,7 +93,7 @@ export default class orderService extends BaseService {
return await this.GET({
orderCode,
method:COMPUTE_COMPENSATE,
method: COMPUTE_COMPENSATE,
}, {
complete
})
... ... @@ -83,7 +104,7 @@ export default class orderService extends BaseService {
return await this.GET({
product_id,
method: PRODUCT_RECOMMEND,
},{
}, {
complete
})
}
... ...
... ... @@ -20,7 +20,8 @@ Page({
paySuccessText: '支付成功!',
compensale: '',
_triggerObserer: true,
orderCode: 0
orderCode: 0,
isStore:false
},
onLoad: function (option) {
... ... @@ -36,7 +37,8 @@ Page({
this.fetchComputeCompensate(orderCode)
}
this.setData({
orderCode
orderCode,
isStore:option.isStore
})
}
},
... ...
... ... @@ -6,14 +6,15 @@
</view>
<text class="successText">{{paySuccessText}}</text>
<view>
<text class="compensateText"> 如卖家原因导致交易失败,您可获赔付{{compensale}}元保证金,建议您设置支付宝账号作为赔偿收款账户,如未绑定支付宝账号则视为放弃赔偿。</text>
<text class="compensateText" wx:if="{{!isStore}}"> 如卖家原因导致交易失败,您可获赔付{{compensale}}元保证金,建议您设置支付宝账号作为赔偿收款账户,如未绑定支付宝账号则视为放弃赔偿。</text>
<text class="compensateText center" wx:else> 请联系店内潮流顾问为您进行提货服务!</text>
</view>
<view class="checkOrderContainer" bindtap='checkOrderClick'>
<text class="checkOrderText">{{checkOrderButtonText}}</text>
</view>
<view bindtap="lookAround">
<view bindtap="lookAround" wx:if="{{!isStore}}">
<text class="lookAround">{{lookAround}}</text>
</view>
... ...
... ... @@ -87,3 +87,8 @@
width: 100%;
}
.center{
display: flex;
align-items: center;
justify-content: center;
}
... ...
... ... @@ -6,7 +6,7 @@ import router from '../../router/index.js'
* orderCode 订单号
* fromWhere 支付来源页面 0:确认订单页面,1:订单列表,2:订单详情
*/
export const prePay = function (productId, orderCode,fromWhere) {
export const prePay = function (productId, orderCode, fromWhere, isStore) {
let api = new orderService()
wx.showLoading({
title: '',
... ... @@ -22,7 +22,7 @@ export const prePay = function (productId, orderCode,fromWhere) {
api.prePay(orderCode, openID, () => wx.hideLoading())
.then(data => {
if (data) {
callWxPay(data, productId, orderCode, fromWhere)
callWxPay(data, productId, orderCode, fromWhere, isStore)
}
})
.catch(error => {
... ... @@ -31,9 +31,9 @@ export const prePay = function (productId, orderCode,fromWhere) {
} else {
//提示重新登录
}
}
}
function callWxPay(data, productId, orderCode, fromWhere) {
function callWxPay(data, productId, orderCode, fromWhere ,isStore) {
let that = this;
// let orderCode = ;
wx.requestPayment({
... ... @@ -42,7 +42,8 @@ function callWxPay(data, productId, orderCode, fromWhere) {
console.log('orderCode:' + orderCode + '==productID:' + productId);
let params = {
orderCode: orderCode,
product_id: productId
product_id: productId,
isStore
}
router.go('orderSuccess', params);
},
... ... @@ -52,10 +53,10 @@ function callWxPay(data, productId, orderCode, fromWhere) {
orderCode: orderCode
}
if (res.errMsg == 'requestPayment:fail cancel') {
if(fromWhere == 0){
if (fromWhere == 0) {
router.go('orderDetail', params);
}
} else {
wx.showModal({
content: res.errMsg,
... ... @@ -70,4 +71,4 @@ function callWxPay(data, productId, orderCode, fromWhere) {
}
}
})
}
\ No newline at end of file
}
... ...
// dist/pages/orderDetail/index.js
import OrderDetailService from './orderDetailService.js'
import OrderActionService from '../../components/order/orderActionService.js';
import { getImgUrl, formatTimeByMin } from '../../utils/index.js';
import { showDialog } from '../../components/order/orderActionUtil.js';
import { prePay } from '../order/wxpay.js'
import {getImgUrl, formatTimeByMin} from '../../utils/index.js';
import {showDialog} from '../../components/order/orderActionUtil.js';
import {prePay} from '../order/wxpay.js'
import router from '../../router/index.js'
import Yas from '../../utils/yas';
const BUY_AGAIN = 'buy_again';
const NOW_BUY = 'now_buy';
const SHOW_EXPRESS = 'show_express';
var interval;
let interval;
let yas;
... ... @@ -20,11 +20,12 @@ Page({
* 页面的初始数据
*/
data: {
detailApi:Object,
orderActionApi:Object,
data:{},
detailApi: Object,
orderActionApi: Object,
data: {},
timer: '',
lastIndex: 0,
orderCode: ''
},
/**
... ... @@ -33,14 +34,13 @@ Page({
onLoad: function (options) {
yas = new Yas(this);
yas.pageOpenReport();
let orderCode = options.orderCode
let api = new OrderDetailService();
let orderActionApi = new OrderActionService();
this.setData({ detailApi: api,
orderActionApi: orderActionApi});
if(orderCode){
this.fetchOrderDetail(orderCode);
}
this.setData({
detailApi: api,
orderActionApi: orderActionApi,
orderCode: options.orderCode
});
},
/**
... ... @@ -54,24 +54,25 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.fetchOrderDetail(this.data.orderCode);
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
if (interval) {
clearInterval(interval);
}
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
if(interval){
if (interval) {
clearInterval(interval);
}
},
/**
... ... @@ -95,7 +96,7 @@ Page({
},
fetchOrderDetail: function(code){
fetchOrderDetail: function (code) {
let that = this;
let params = {
orderCode: code,
... ... @@ -104,8 +105,8 @@ Page({
this.data.detailApi.getOrderDetailInfo(params, () => {
wx.hideLoading();
}).then(data => {
if (data.goodsInfo && data.goodsInfo.goodImg){
data.goodsInfo.goodImg = getImgUrl(data.goodsInfo.goodImg, 270,270);
if (data.goodsInfo && data.goodsInfo.goodImg) {
data.goodsInfo.goodImg = getImgUrl(data.goodsInfo.goodImg, 270, 270);
}
let lastIndex = 0;
if (data && data.buttons && data.buttons.length > 0) {
... ... @@ -116,21 +117,34 @@ Page({
lastIndex: lastIndex
});
if (data.statusDetail && data.statusDetail.leftTime){
if (data.statusDetail && data.statusDetail.leftTime) {
let leftTime = data.statusDetail.leftTime;
// let leftTime = 30;
let timer = that.data.timer;
if (leftTime > 0){
if (leftTime > 0) {
that.setData({
timer: formatTimeByMin(leftTime, 'm:s')
});
interval = setInterval(() => {
leftTime = leftTime - 1;
timer = formatTimeByMin(leftTime, 'm:s');
if (timer <= 0) {
timer = '00:00'
console.log(leftTime);
if (leftTime <= 0) {
timer = '00:00';
setTimeout(() => {
that.fetchOrderDetail(code);
}, 2000);
clearInterval(interval);
}
that.setData({
timer: timer,
});
}, 1000);
}
} else {
that.setData({
timer: null,
});
}
})
... ... @@ -145,12 +159,12 @@ Page({
if (actionCode == BUY_AGAIN) {
let params = {
id: productId
id: productId
}
router.go('productDetail', params);
} else if (actionCode == NOW_BUY) {
console.log("== 去支付页面===")
prePay(productId, orderCode, 2);
prePay(productId, orderCode, 2, this.data.data.isOffline === 'Y');
} else if (actionCode == SHOW_EXPRESS) {
let params = {
orderCode
... ... @@ -161,15 +175,16 @@ Page({
}
},
onClickProduct: function() {
let productId = this.data.data.goodsInfo.productId || '';
onClickProduct: function () {
let productId = this.data.data.goodsInfo.productId || '';
let params = {
id: productId
}
router.go('productDetail', params);
}
if (this.data.data.isOffline === 'Y') return;
router.go('productDetail', params);
},
onClickLogistics: function(e) {
onClickLogistics: function (e) {
let orderCode = e.currentTarget.dataset.orderCode || '';
let params = {
orderCode
... ... @@ -177,11 +192,11 @@ Page({
router.go('logistics', params);
},
onCopyOrderCode: function() {
onCopyOrderCode: function () {
let orderCode = String(this.data.data.orderCode) || '';
wx.setClipboardData({
data: orderCode,
success (res) {
success(res) {
}
})
... ...
... ... @@ -18,7 +18,7 @@
</view>
</view>
<image class='order-detail-right-arrow-image' src='../../assets/images/right-arrow@3x.png'></image>
</view>
<view class='order-detail-split-line' wx:if="{{data.lastExpressInfo}}"></view>
... ... @@ -32,13 +32,13 @@
</view>
</view>
<view class='order-detail-split-line'></view>
<orderproductinfo id="orderproductinfo" product-info="{{data.goodsInfo}}" bindtap='onClickProduct' />
<orderproductinfo id="orderproductinfo" isStore="{{data.isOffline === 'Y'}}" product-info="{{data.goodsInfo}}" bindtap='onClickProduct' />
<view class='order-detail-split-line'></view>
<view class='order-detail-count-view' style='margin-top:28rpx;'>
<text class='order-detail-sum-grey-txt'>商品金额:</text>
<text class='order-detail-sum-grey-txt'>¥{{data.priceInfo.goodPrice}}</text>
</view>
<view class='order-detail-count-view'>
<view class='order-detail-count-view' wx:if="{{data.isOffline !== 'Y'}}">
<text class='order-detail-sum-grey-txt'>运费:</text>
<text class='order-detail-sum-grey-txt'>¥{{data.priceInfo.feePrice}}</text>
</view>
... ... @@ -53,7 +53,8 @@
</view>
<view class='order-detail-order-code-view'>
<text class='order-detail-create-time-txt'>订单编号:</text>
<text class='order-detail-create-time-txt'>{{data.orderCode}}</text>
<text class='order-detail-create-time-txt' wx:if="{{data.isOffline !== 'Y'}}">{{data.orderCode}}</text>
<text class='order-detail-create-time-txt' wx:else>{{data.orderCode}} (门店订单)</text>
<image class='order-detail-order-copy-image' bindtap='onCopyOrderCode' src='../../assets/images/copyordercode@3x.png'></image>
</view>
<view wx:if='{{data.payment}}' class='order-detail-pay-mode-view'>
... ... @@ -70,7 +71,7 @@
</view>
<view class='order-detail-bottom-button-view'>
<block wx:for='{{data.buttons}}' wx:key='{{index}}'>
<button class='{{index == lastIndex ? "order-detail-bottom-selected-button":"order-detail-bottom-unselected-button"}}' catchtap='onButtonClick' data-button-code='{{item.code}}' data-order-code='{{data.orderCode}}' data-product-id='{{data.goodsInfo.productId}}'>{{item.text}}</button>
<button class='{{index == lastIndex && item.code !== "cancel_order" && item.code !== "del_order" ? "order-detail-bottom-selected-button":"order-detail-bottom-unselected-button"}}' catchtap='onButtonClick' data-button-code='{{item.code}}' data-order-code='{{data.orderCode}}' data-product-id='{{data.goodsInfo.productId}}'>{{item.text}}</button>
</block>
</view>
</view>
... ...
... ... @@ -4,4 +4,4 @@
"orderlistcell":"./orderlistcell",
"no-data-show-view": "../../../components/no-data-show-view/no-data-show-view"
}
}
\ No newline at end of file
}
... ...
... ... @@ -20,13 +20,13 @@
</block>
<view class="load_more_view" wx:if="{{tab.showLoadMoreView}}">加载中...</view>
</scroll-view>
</block>
</block>
<block wx:else>
<view class='empty'>
<no-data-show-view></no-data-show-view>
</view>
</block>
</swiper-item>
</swiper>
</swiper>
</view>
</view>
\ No newline at end of file
</view>
... ...
... ... @@ -4,4 +4,4 @@
"orderproductinfo": "../../components/order/orderproductinfo",
"orderaction": "../../components/order/orderaction"
}
}
\ No newline at end of file
}
... ...
<!--src/pages/orderList/orderlistcell.wxml-->
<view class='orderlistcell-root-container' data-order-code='{{item.orderCode}}' bindtap='onItemClick'>
<orderproductinfo id="orderproductinfo" product-info="{{item.goodsInfo}}" statu-str="{{item.statuStr}}">
<orderproductinfo id="orderproductinfo" product-info="{{item.goodsInfo}}" statu-str="{{item.statuStr}}" isStore="{{item.isOffline === 'Y'}}">
</orderproductinfo>
<view class='space-view'></view>
<orderaction id="orderaction" buttons="{{item.buttons}}" timer='{{item.leftTime}}' order-code="{{item.orderCode}}" product-id='{{item.goodsInfo.productId}}'/>
<orderaction id="orderaction" buttons="{{item.buttons}}" timer='{{item.leftTime}}' order-code="{{item.orderCode}}" product-id='{{item.goodsInfo.productId}}' storeId="{{item.storeId}}" isStore="{{item.isOffline === 'Y'}}"/>
<view class='orderlistcell-root-split-line'></view>
</view>
... ...
... ... @@ -7,6 +7,12 @@ import { connect } from '@tarojs/redux';
import { showSizeBox, showSharesheet, showSnapshot } from '../../actions/productDetail'
import config from '../../config.js'
import goYohoBuy from '../../assets/images/goYohoBuy@3x.png';
import goOnLine from '../../assets/images/goOnLine@3x.png';
import storeLocation from '../../assets/images/store-location@3x.png';
import router from '../../router/index.js';
const urlParse = require('url');
const queryString = require('querystring');
import getPrivateKey from '../../libs/request/getPrivateKey.js';
import share from '../../static/images/share.png';
import collect from '../../static/images/collect.png';
... ... @@ -48,6 +54,8 @@ export default class ProductDetail extends Component {
collectTitle: '收藏',
isFavorite: false,
snapshootShareData: {},
skup: '',
storeId: -1,
productDec: {
color: {
text: '颜色',
... ... @@ -92,22 +100,93 @@ export default class ProductDetail extends Component {
yas = new Yas(this.$scope);
yas.pageOpenReport();
let options = this.$router.params;
if (options && options.scene) {
if (options && options.q) {
let url = decodeURIComponent(options.q);
let urlObj = urlParse.parse(url);
if (urlObj.host === 'o.yohobuy.com' && urlObj.pathname === '/ufo') {
const queryObj = queryString.parse(urlObj.query);
const p = queryObj.p;
const storeArr = p.split(',') || [];
const storeId = storeArr[1];
if (queryObj.skup) {
wx.hideShareMenu();
this.setState({
skup: queryObj.skup,
storeId
})
this.loadStoreProductInfo(queryObj.skup, storeId);
} else {
this.loadElement({ id: queryObj.productId || queryObj.skn });
}
}
} else {
if (options && options.scene) {
console.log(options.scene);
// let code = '073c8bb068f4fc9d8dc573b5d4284e3f';
let code = options.scene;
getQRCodeSource(code).then(json => {
if (json) {
this.loadElement(json);
}
if (json) {
this.loadElement(json);
}
})
.catch(error => {
});
} else {
.catch(error => {
});
} else {
this.loadElement(options);
}
}
}
async loadStoreProductInfo(skup, storeId) {
await getPrivateKey();
productDetailModel.getStoreProductDetail(skup, storeId).then(res => {
console.log(res);
if (res && res.code === 200) {
let data = res.data || {};
let image_list = data.image_list;
let goodsList = { image_list }
let imageSize = image_list.length;
let default_image = imageSize > 0 ? image_list[0] : '';
let productInfo = data;
let seriesObj = {
text: '系列',
value: data.series_name
};
seriesObj = data.series_name ? [seriesObj] : [];
this.setState({
productInfo,
id: data.product_id,
imageSize: imageSize,
goodsList: goodsList,
swiperNum: `1 | ${imageSize}`,
productDec: [
{
text: '颜色',
value: data.color_name
}, {
text: '尺码',
value: data.size_name
}, {
text: '品牌',
value: data.brand_name
},
...seriesObj
, {
text: '发售时间',
value: data.sale_time
}, {
text: '货号',
value: data.product_code
}, {
text: '库存编号',
value: data.skup
}
]
})
}
});
}
loadElement(options) {
let productId = options.id
... ... @@ -215,6 +294,9 @@ export default class ProductDetail extends Component {
}
getFavoriteState(id) {
if(!id){
return;
}
productDetailModel.getFavoriteState(id).then(ret => {
if (ret && ret.code === 200) {
this.setState({
... ... @@ -334,6 +416,36 @@ export default class ProductDetail extends Component {
})
}
onStoreBuyNow() {
let { skup, productInfo, storeId } = this.state;
event.emit('user-is-login', () => {
this.judgeCanBuy(skup, productInfo, storeId);
}, () => {
this.judgeCanBuy(skup, productInfo, storeId);
})
}
judgeCanBuy(skup, productInfo, storeId) {
productDetailModel.createPaymentinfo(skup).then(data => {
if (data && data.code === 200) {
let { product_id } = productInfo;
Taro.navigateTo({
url: `/pages/order/orderConfirm/orderConfirm?is_store=1&skup=${skup}&product_id=${product_id}&store_id=${storeId}`,
})
} else {
Taro.showToast({
title: data.message,
icon: 'none'
})
}
}).catch(error => {
Taro.showToast({
title: error.message,
icon: 'none'
})
})
}
goYohoBuyMinApp() {
wx.navigateToMiniProgram({
appId: 'wx084ab813d88c594b',
... ... @@ -341,7 +453,14 @@ export default class ProductDetail extends Component {
}
})
}
goOnLineProuduct(id) {
let params = {
id
}
router.go('productDetail', params)
}
componentWillUnmount() {
if (this.props.productDetail.showSharesheet) {
... ... @@ -356,18 +475,23 @@ export default class ProductDetail extends Component {
let {showSizeBox} = this.props;
showSizeBox(false);
}
event.removeAll('SHARE_FRIENDS');
event.removeAll('SHARE_MOMENTS');
event.removeAll('SHARE_CANCEL');
event.removeAll('SHARE_CANCEL_MOMENTS');
}
render() {
let {productInfo, recommendList, goodsList, productDec, id} = this.state;
let {productInfo, recommendList, goodsList, productDec, id, skup} = this.state;
let imageList = goodsList.image_list || [];
let status = productInfo.status;
return (
<View className="product-page">
<View className="swiperNum">{this.swiperNum}</View>
<Swiper className='product-swiper' autoplay onChange={this.onChangeSwiper}>
{
imageList.map((item, index) => {
!skup && imageList.map((item, index) => {
return (
<SwiperItem key={index}>
<Image src={getImgUrl(item.image_url, 750, 750)} class="swiper-img" mode="aspectFill"/>
... ... @@ -375,18 +499,39 @@ export default class ProductDetail extends Component {
)
})
}
{
skup && imageList.map((item, index) => {
return (
<SwiperItem key={index}>
<Image src={getImgUrl(item, 750, 750)} class="swiper-img" mode="aspectFill"/>
</SwiperItem>
)
})
}
</Swiper>
<View className="product-ctr">
<View className="collect" onClick={this.onClickCollect.bind(this, id)}>
<Image src={isFavorite ? collect : collectOff} className="collect-icon"/>
<Text className="text">{collectTitle}</Text>
</View>
<View className="share" onClick={this.onClickShare.bind(this, id)}>
<Image src={share} className="share-icon"/>
<Text className="text">分享</Text>
{
!skup && (<View className="product-ctr">
<View className="collect" onClick={this.onClickCollect.bind(this, id)}>
<Image src={isFavorite ? collect : collectOff} className="collect-icon"/>
<Text className="text">{collectTitle}</Text>
</View>
<View className="share" onClick={this.onClickShare.bind(this, id)}>
<Image src={share} className="share-icon"/>
<Text className="text">分享</Text>
</View>
</View>)
}
{
skup && (
<View className="product-ctr">
<View className="store-title">
<Image className="store-image" src={storeLocation}></Image>{productInfo.store_name}
</View>
</View>
</View>
)
}
<View className="product-name">{productInfo.product_name}</View>
... ... @@ -400,22 +545,43 @@ export default class ProductDetail extends Component {
)
})
}
<View className="product-dec">
<View className={ skup ? "product-dec margin-bottom" : "product-dec"}>
正品保障<Text className="c"></Text> 专业鉴定<Text className="c"></Text> 银联担保
</View>
<View className="recommend-goods">
{
!skup && (<View className="recommend-goods">
<View className="title">相关推荐</View>
<ProductList list={recommendList}></ProductList>
</View>
</View>)
}
<View className="product-buy">
{
!skup && (<View className="product-buy">
{/* <View className="sell-btn">出售</View> */}
<View className="buy-btn" onClick={this.onClickBuy}>购买
{ productInfo.least_price && <Text className="price">¥{productInfo.least_price}</Text>}
</View>
</View>
</View>)
}
{
skup && status === 1 && (<View className="product-buy">
{/* <View className="sell-btn">出售</View> */}
<View className="buy-btn store-info" onClick={this.onStoreBuyNow.bind(this)}>店内闪购
{productInfo.price && <Text className="price">¥{productInfo.price}</Text>}
</View>
</View>)
}
{
skup && (status === 2 || status === 0) && (<View className="product-buy product-none-top">
{/* <View className="sell-btn">出售</View> */}
<View className="buy-btn disable">
{ status === 2 ? '已售出' : ''}
{ status === 0 ? '已下架' : '' }
</View>
</View>)
}
{
this.props.productDetail.showSharesheet &&
... ... @@ -432,8 +598,9 @@ export default class ProductDetail extends Component {
<SelectSize sizeList={goodsList.size_list} product_id={id} onConfirmSelect={this.confirmSelect.bind(this)}></SelectSize>
}
<Image className="goYohoBuy" onClick={this.goYohoBuyMinApp.bind(this)} src={goYohoBuy} mode="aspectFill" />
{
skup ? <Image className="goYohoBuy" onClick={this.goOnLineProuduct.bind(this, id)} src={goOnLine} mode="aspectFill" /> : <Image className="goYohoBuy" onClick={this.goYohoBuyMinApp.bind(this)} src={goYohoBuy} mode="aspectFill" />
}
</View>
)
}
... ...
... ... @@ -124,6 +124,27 @@
}
}
.store-image {
width: 48px;
height: 48px;
margin-right: 10px;
}
.store-title {
width: 100%;
text-align: center;
font-family: SFProText-Medium;
color: #A69073;
font-weight: 500;
display: flex;
justify-content: center;
align-items: center;
}
.margin-bottom {
margin-bottom: 180px;
}
.recommend-goods {
padding-bottom: 120px;
... ... @@ -176,6 +197,14 @@
text-align: center;
}
}
.disable {
background-color: #cccccc;
border: 0;
}
}
.product-none-top {
border: 0;
}
.goYohoBuy {
... ...