Authored by 陈峰

Merge branch 'feature/group-miniapp' into 'release/6.9.5'

Feature/group miniapp



See merge request !15
registry=http://npm.yohops.com
... ...
... ... @@ -9,10 +9,22 @@
"postcss": false,
"minified": false,
"newFeature": true,
"autoAudits": false
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"compileType": "miniprogram",
"libVersion": "2.2.4",
"simulatorType": "wechat",
"simulatorPluginLibVersion": {},
"condition": {
"search": {
"current": -1,
... ... @@ -30,7 +42,7 @@
"list": []
},
"miniprogram": {
"current": 14,
"current": 15,
"list": [
{
"id": -1,
... ... @@ -124,6 +136,13 @@
"pathName": "pages/productDetail/index",
"query": "q=https%3A%2F%2Fo.yohobuy.com%2Fufo%3Fp%3D517449%2C1%26skup%3D517449%26skn%3D10003791&scancode_time=1553151155",
"scene": 1011
},
{
"id": 15,
"name": "定单确认",
"pathName": "pages/order/orderConfirm/orderConfirm",
"query": "product_id=10014834&skup=14044&user_activity_id=1204",
"scene": 1011
}
]
}
... ...
... ... @@ -7,7 +7,7 @@ export default {
// production
api: 'http://java-yohoufo-fore.test3.ingress.dev.yohocorp.com/ufo-gateway',
yohoApi: 'http://api-test3.dev.yohocorp.com',
yohoLogin: 'http://java-yoho-wechat.test3.ingress.dev.yohocorp.com',
yohoLogin: 'http://api-test3.dev.yohocorp.com',
activityHost: 'http://yoho-activity-platform.test3.ingress.dev.yohocorp.com',
reportHost: 'https://app.yoho.cn/collect/v3',
yasHost: 'https://analysis.yohobuy.com/yas_mobile'
... ...
... ... @@ -6,6 +6,6 @@
<text class="productPrice">¥{{productInfo.goodPrice}}</text>
<text class="productName">{{productInfo.productName}}</text>
<text class="productColor" wx:if="{{isStore}}">{{productInfo.colorName + ',' + productInfo.sizeName + ',' +productInfo.skup}}</text>
<text class="productColor" wx:else>{{productInfo.colorName + ',' + productInfo.sizeName}}</text>
<text class="productColor" wx:else>{{(productInfo.colorName || '') + ',' + (productInfo.sizeName || '')}}</text>
</view>
</view>
... ...
... ... @@ -9,10 +9,12 @@ import orderService from '../orderService'
import {getImgUrl} from '../../../utils';
import router from '../../../router/index.js'
import { prePay } from '../../order/wxpay.js'
import Yas from '../../../utils/yas';
import Yas from '../../../utils/yas'
let yas;
const ACTIVITY_TYPE = 18; // 砍价
const api = new orderService();
Page({
... ... @@ -26,23 +28,36 @@ Page({
unCheckImage: '../../../assets/images/unselect@2x.png',
isStore: 0,
storeId: 0,
skup: '',
coupons: [],
selectCouponCode: '',
selectCouponAmount: '',
selectingCoupon: false
selectingCoupon: false,
user_activity_id: '' // 有值代表砍价
},
onLoad: async function (option) {
yas = new Yas(this);
yas.pageOpenReport();
this.setData({
isStore: Number(option.is_store) || 0,
storeId: option.store_id || 0,
skup: option.skup || '',
product_id: option.product_id || '',
hasAddress: false
hasAddress: false,
user_activity_id: option.user_activity_id || ''
})
await this.fetchData(option.is_store);
if (!option.is_store) {
},
async onShow() {
let userInfo = wx.getStorageSync('userInfo');
if (!(userInfo && userInfo.uid && userInfo.session_key)) {
router.go('nativeLogin');
return;
}
await this.fetchData(this.data.isStore);
if (!this.data.isStore) {
await this.fetchAddress()
}
},
... ... @@ -72,10 +87,19 @@ Page({
coupon_code: code
}, () => wx.hideLoading());
} else {
info = await api.orderCompute({
const params = {
skup: this.data.skup,
coupon_code: code
}, () => wx.hideLoading());
};
if (this.data.user_activity_id) {
Object.assign(params, {
user_activity_id: this.data.user_activity_id,
activity_type: ACTIVITY_TYPE
});
}
info = await api.orderCompute(params, () => wx.hideLoading());
}
} catch(e) {}
... ... @@ -99,6 +123,14 @@ Page({
skup: this.data.skup,
store_id: this.data.storeId
}
if (this.data.user_activity_id) {
Object.assign(params, {
user_activity_id: this.data.user_activity_id,
activity_type: ACTIVITY_TYPE
})
}
let data;
if (isStore) {
data = await api.createOfflinePayment(params, () => wx.hideLoading())
... ... @@ -110,7 +142,17 @@ Page({
})
data.promotionFormulaList.splice(index,1)
} else {
data = await api.createPaymentInfo(params, () => wx.hideLoading())
try {
data = await api.createPaymentInfo(params, () => wx.hideLoading())
} catch (e) {
console.log(e)
wx.showModal({
title: '失败',
content: e.message,
showCancel: false,
})
return;
}
}
api.orderSelectCoupon(this.data.skup, () => wx.hideLoading()).then(data => {
... ... @@ -191,11 +233,19 @@ Page({
let skup = this.data.skup
let channelNo = '';
let couponCode = this.data.selectCouponCode || '';
let extra = null;
if (this.data.user_activity_id) {
extra = {
user_activity_id: this.data.user_activity_id,
activity_type: ACTIVITY_TYPE
};
}
// wx.showLoading({
// title: '',
// })
data = await api.buyerSubmit(skup, channelNo, addressId, couponCode, () => wx.hideLoading());
data = await api.buyerSubmit({skup, channelNo, addressId, couponCode, extra}, () => wx.hideLoading());
}
if (data && data.orderCode) {
let skup = this.data.skup
... ...
... ... @@ -6,7 +6,8 @@
wx:else></storeAddress>
<productCell productInfo="{{good}}" isStore="{{isStore === 1}}"></productCell>
<couponCell bindselect="showSelectCoupon" amount="{{selectCouponAmount}}"></couponCell>
<!-- // 砍价没有优惠券 -->
<couponCell wx:if="{{!user_activity_id}}" bindselect="showSelectCoupon" amount="{{selectCouponAmount}}"></couponCell>
<priceCell promotionFormulaList="{{promotionFormulaList}}" damagesDesc="{{damagesDesc}}" isStore="{{isStore === 1}}"></priceCell>
<payDeliveryCell paymentWay="{{paymentWay}}" deliveryWay="{{deliveryWay}}"></payDeliveryCell>
</scroll-view>
... ...
... ... @@ -56,15 +56,15 @@ export default class orderService extends BaseService {
})
}
async buyerSubmit(skup, channelNo = '2919', addressId, couponCode, complete) {
async buyerSubmit({skup, channelNo = '2919', addressId, couponCode, complete, extra = {}} ) {
return await this.GET({
return await this.GET(Object.assign({
method: BUYER_SUBMIT,
skup,
channelNo,
addressId,
coupon_code: couponCode || ''
}, {
}, extra), {
path: '/shopping',
complete
})
... ...