qq小程序开发

feat/task1-c-wallet
Devil 2019-12-01 19:31:06 +08:00
parent b4b83012ef
commit 9d3967460e
65 changed files with 1324 additions and 657 deletions

View File

@ -839,7 +839,7 @@ Page({
// 自定义分享
onShareAppMessage() {
var user = app.get_user_info(this, 'onShareAppMessage') || null;
var user = app.get_user_cache_info() || null;
var user_id = (user != null && (user.id || null) != null) ? user.id : 0;
return {
title: app.data.application_title +'-'+ this.data.goods.title,

View File

@ -160,7 +160,11 @@ Page({
}
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {
@ -206,7 +210,11 @@ Page({
self.setData({is_default: value});
app.showToast(res.data.msg, 'success');
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -163,7 +163,11 @@ Page({
}
app.showToast(res.data.msg, 'success');
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -161,7 +161,11 @@ Page({
}
app.showToast(res.data.msg, 'success');
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -217,7 +217,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -152,7 +152,11 @@ Page({
}
}
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {
@ -196,7 +200,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -162,7 +162,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -162,7 +162,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -209,7 +209,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -67,8 +67,8 @@ App({
// 请求地址
request_url: "{{request_url}}",
// request_url: 'http://tp5-dev.com/',
// request_url: 'https://test.shopxo.net/',
request_url: 'http://tp5-dev.com/',
request_url: 'https://dev.shopxo.net/',
// 基础信息
application_title: "{{application_title}}",

View File

@ -27,7 +27,8 @@
"pages/user-orderaftersale/user-orderaftersale",
"pages/user-orderaftersale-detail/user-orderaftersale-detail",
"pages/coupon/coupon",
"pages/user-coupon/user-coupon"
"pages/user-coupon/user-coupon",
"pages/extraction-address/extraction-address"
],
"window": {
"navigationBarTitleText": "{{application_title}}",

View File

@ -13,13 +13,15 @@ Page({
// 初始化
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
}
}
},
@ -60,8 +62,11 @@ Page({
}, 2000);
} else {
this.setData({form_submit_loading: false});
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -13,10 +13,10 @@
</view>
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>

View File

@ -8,13 +8,15 @@ Page({
payment_list: [],
goods_list: [],
address: null,
address_id: 0,
address_id: null,
total_price: 0,
user_note_value: '',
is_first: 1,
extension_data: [],
payment_id: 0,
common_order_is_booking: 0,
common_site_type: 0,
extraction_address: [],
// 优惠劵
plugins_coupon_data: null,
@ -23,17 +25,9 @@ Page({
popup_plugins_coupon_status: false,
},
onLoad(params) {
if((params.data || null) == null || app.get_length(JSON.parse(params.data)) == 0)
//params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}';
if((params.data || null) != null && app.get_length(JSON.parse(params.data)) > 0)
{
qq.alert({
title: '温馨提示',
content: '订单信息有误',
buttonText: '确认',
success: () => {
qq.navigateBack();
},
});
} else {
this.setData({ params: JSON.parse(params.data)});
// 删除地址缓存
@ -42,13 +36,22 @@ Page({
},
onShow() {
qq.setNavigationBarTitle({title: app.data.common_pages_title.buy});
this.init();
this.setData({is_first: 0});
this.setData({ is_first: 0 });
},
// 获取数据列表
init() {
// 订单参数信息是否正确
if (this.data.params == null) {
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: '订单信息有误',
});
qq.stopPullDownRefresh();
return false;
}
// 本地缓存地址
if(this.data.is_first == 0)
{
@ -57,12 +60,7 @@ Page({
{
this.setData({
address: cache_address,
address_id: cache_address.id
});
} else {
this.setData({
address: null,
address_id: 0
address_id: cache_address.id || null,
});
}
}
@ -97,6 +95,8 @@ Page({
extension_data: data.extension_data || [],
data_list_loding_status: 3,
common_order_is_booking: data.common_order_is_booking || 0,
common_site_type: data.common_site_type || 0,
extraction_address: data.base.extraction_address || [],
plugins_coupon_data: data.plugins_coupon_data || null,
});
@ -113,19 +113,14 @@ Page({
}
// 地址
if (this.data.address == null || this.data.address_id == 0) {
if((data.base.address || null) != null) {
this.setData({
address: data.base.address,
address_id: data.base.address.id,
});
qq.setStorage({
key: app.data.cache_buy_user_address_select_key,
data: data.base.address,
});
}
}
this.setData({
address: data.base.address || null,
address_id: ((data.base.address || null) != null && (data.base.address.id || null) != null) ? data.base.address.id : null,
});
qq.setStorage({
key: app.data.cache_buy_user_address_select_key,
data: data.base.address || null,
});
// 支付方式
this.payment_list_data(data.payment_list);
@ -135,7 +130,9 @@ Page({
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'init')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
@ -171,9 +168,11 @@ Page({
data['coupon_id'] = this.data.plugins_use_coupon_id;
// 数据验证
var validation = [
{ fields: 'address_id', msg: '请选择地址' }
];
var validation = [];
if (this.data.common_site_type == 0 || this.data.common_site_type == 2)
{
validation.push({ fields: 'address_id', msg: '请选择地址', is_can_zero: 1 });
}
if (this.data.common_order_is_booking != 1) {
validation.push({ fields: 'payment_id', msg: '请选择支付方式' });
}
@ -263,4 +262,21 @@ Page({
this.init();
},
// 地址选择事件
address_event(e) {
if(this.data.common_site_type == 0)
{
qq.navigateTo({
url: '/pages/user-address/user-address?is_back=1'
});
} else if (this.data.common_site_type == 2)
{
qq.navigateTo({
url: '/pages/extraction-address/extraction-address?is_back=1'
});
} else {
app.showToast('当前模式不允许使用地址');
}
},
});

View File

@ -1,125 +1,132 @@
<view qq:if="{{goods_list.length > 0}}" class="page">
<!-- -->
<view class="address bg-white arrow-right">
<navigator url="/pages/user-address/user-address?is_back=1" hover-class="none">
<view qq:if="{{address != null}}">
<view class="address-base oh">
<text>{{address.name}}</text>
<text class="fr">{{address.tel}}</text>
<block qq:if="{{common_site_type == 1}}">
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: 2, msg: '展示型不允许提交订单'}}"></template>
</block>
<block qq:else>
<view qq:if="{{goods_list.length > 0}}" class="page">
<!-- -->
<block qq:if="{{common_site_type == 0 || common_site_type == 2}}">
<view class="address bg-white arrow-right" bindtap="address_event">
<view qq:if="{{address != null}}">
<view class="address-base oh">
<text qq:if="{{(address.alias || null) != null}}" class="address-alias">{{address.alias}}</text>
<text>{{address.name}}</text>
<text class="fr">{{address.tel}}</text>
</view>
<view class="address-detail oh">
<image class="icon fl" src="/images/user-address.png" mode="widthFix" />
<view class="text fr">{{address.province_name}}{{address.city_name}}{{address.county_name}}{{address.address}}</view>
</view>
</view>
<view class="address-detail oh">
<image class="icon fl" src="/images/user-address.png" mode="widthFix" />
<view class="text fr">{{address.province_name}}{{address.city_name}}{{address.county_name}}{{address.address}}</view>
<view qq:if="{{address == null}}" class="no-address cr-888">
</view>
</view>
<view qq:if="{{address == null}}" class="no-address cr-888">
</view>
</navigator>
</view>
<view class="address-divider spacing-mb"></view>
<view class="address-divider spacing-mb"></view>
</block>
<!-- -->
<view class="goods bg-white spacing-mb">
<view qq:for="{{goods_list}}" qq:key="key" class="goods-item oh">
<image class="goods-image fl" src="{{item.images}}" mode="aspectFill" />
<view class="goods-base">
<view class="goods-title multi-text">{{item.title}}</view>
<block qq:if="{{item.spec != null}}">
<view class="goods-spec cr-888" qq:for="{{item.spec}}" qq:key="key" qq:for-item="spec">{{spec.type}}:{{spec.value}}
<!-- -->
<view class="goods bg-white spacing-mb">
<view qq:for="{{goods_list}}" qq:key="key" class="goods-item oh">
<image class="goods-image fl" src="{{item.images}}" mode="aspectFill" />
<view class="goods-base">
<view class="goods-title multi-text">{{item.title}}</view>
<block qq:if="{{item.spec != null}}">
<view class="goods-spec cr-888" qq:for="{{item.spec}}" qq:key="key" qq:for-item="spec">{{spec.type}}:{{spec.value}}
</view>
</block>
</view>
<view class="oh goods-price">
<text class="sales-price">{{item.price}}
</text>
<text qq:if="{{item.original_price > 0}}" class="original-price">{{item.original_price}}
</text>
<text class="buy-number cr-888">x{{item.stock}}
</text>
</view>
</view>
</view>
<!-- -->
<view class="content-textarea-view bg-white spacing-mb">
<textarea qq:if="{{!popup_plugins_coupon_status}}" bindinput="bind_user_note_event" value="{{user_note_value}}" maxlength="60" placeholder="留言" class="wh-auto" />
<view qq:if="{{popup_plugins_coupon_status}}" class="cr-888">{{user_note_value || '留言'}}</view>
</view>
<!-- -->
<view qq:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="plugins-coupon bg-white spacing-mb arrow-right" bindtap="plugins_coupon_open_event">
<text class="cr-666"></text>
<text class="cr-ccc fr">{{plugins_choice_coupon_value}}</text>
</view>
<!-- -->
<view qq:if="{{extension_data.length > 0}}" class="extension-list spacing-mb">
<view qq:for="{{extension_data}}" qq:key="key" class="item oh">
<text class="cr-666 fl">{{item.name}}
</text>
<text class="text-tips fr">{{item.tips}}
</text>
</view>
</view>
<!-- -->
<view qq:if="{{payment_list.length > 0 && common_order_is_booking != 1}}" class="payment-list bg-white oh">
<view class="item tc fl" qq:for="{{payment_list}}" qq:key="key">
<view class="item-content br {{(item.selected || '')}}" data-value="{{item.id}}" bindtap="payment_event">
<image qq:if="{{(item.logo || null) != null}}" class="icon" src="{{item.logo}}" mode="widthFix" />
<text>{{item.name}}</text>
</view>
</view>
</view>
<!-- -->
<view class="buy-nav oh wh-auto">
<view class="nav-base bg-white fl single-text">
<text></text>
<text class="sales-price">{{total_price}}</text>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" bindtap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none"></button>
</view>
</view>
</view>
<view qq:if="{{goods_list.length == 0}}">
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<!-- -->
<component-popup prop-show="{{popup_plugins_coupon_status}}" prop-position="bottom" bindonclose="plugins_coupon_close_event">
<view class="plugins-coupon-popup bg-white">
<view class="close oh">
<view class="fr" catchtap="plugins_coupon_close_event">
<icon type="clear" size="20" />
</view>
</view>
<view qq:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="coupon-container oh br-b">
<view class="not-use-tips tc">
<text bindtap="plugins_coupon_not_use_event">使</text>
</view>
<block qq:for="{{plugins_coupon_data.coupon_list}}" qq:key="item">
<view class="item spacing-mt bg-white" style="border:1px solid {{item.coupon.bg_color_value}};">
<view class="v-left fl">
<view class="base single-text" style="color:{{item.coupon.bg_color_value}};">
<text class="symbol"></text>
<text class="price">{{item.coupon.discount_value}}</text>
<text class="unit">{{item.coupon.type_unit}}</text>
<text qq:if="{{(item.coupon.desc || null) != null}}" class="desc cr-888">{{item.coupon.desc}}</text>
</view>
<view qq:if="{{(item.coupon.use_limit_type_name || null) != null}}" class="base-tips cr-666 single-text">{{item.coupon.use_limit_type_name}}</view>
<view class="base-time cr-888 single-text">{{item.time_start_text}} {{item.time_end_text}}</view>
</view>
<view class="v-right fr" style="background:{{item.coupon.bg_color_value}};" data-index="{{index}}" data-value="{{item.id}}" bindtap="plugins_coupon_use_event">
<text class="circle"></text>
<text>{{plugins_use_coupon_id == item.id ? '已选' : '选择'}}</text>
</view>
</view>
</block>
</view>
<view class="oh goods-price">
<text class="sales-price">{{item.price}}
</text>
<text qq:if="{{item.original_price > 0}}" class="original-price">{{item.original_price}}
</text>
<text class="buy-number cr-888">x{{item.stock}}
</text>
</view>
</view>
</view>
<!-- -->
<view class="content-textarea-view bg-white spacing-mb">
<textarea qq:if="{{!popup_plugins_coupon_status}}" bindinput="bind_user_note_event" value="{{user_note_value}}" maxlength="60" placeholder="留言" class="wh-auto" />
<view qq:if="{{popup_plugins_coupon_status}}" class="cr-888">{{user_note_value || '留言'}}</view>
</view>
<!-- -->
<view qq:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="plugins-coupon bg-white spacing-mb arrow-right" bindtap="plugins_coupon_open_event">
<text class="cr-666"></text>
<text class="cr-ccc fr">{{plugins_choice_coupon_value}}</text>
</view>
<!-- -->
<view qq:if="{{extension_data.length > 0}}" class="extension-list spacing-mb">
<view qq:for="{{extension_data}}" qq:key="key" class="item oh">
<text class="cr-666 fl">{{item.name}}
</text>
<text class="text-tips fr">{{item.tips}}
</text>
</view>
</view>
<!-- -->
<view qq:if="{{payment_list.length > 0 && common_order_is_booking != 1}}" class="payment-list bg-white oh">
<view class="item tc fl" qq:for="{{payment_list}}" qq:key="key">
<view class="item-content br {{(item.selected || '')}}" data-value="{{item.id}}" bindtap="payment_event">
<image qq:if="{{(item.logo || null) != null}}" class="icon" src="{{item.logo}}" mode="widthFix" />
<text>{{item.name}}</text>
</view>
</view>
</view>
<!-- -->
<view class="buy-nav oh wh-auto">
<view class="nav-base bg-white fl single-text">
<text></text>
<text class="sales-price">{{total_price}}</text>
</view>
<view class="fr nav-submit">
<button class="bg-main wh-auto" type="default" bindtap="buy_submit_event" disabled="{{buy_submit_disabled_status}}" hover-class="none"></button>
</view>
</view>
</view>
<view qq:if="{{goods_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<!-- -->
<component-popup prop-show="{{popup_plugins_coupon_status}}" prop-position="bottom" bindonclose="plugins_coupon_close_event">
<view class="plugins-coupon-popup bg-white">
<view class="close oh">
<view class="fr" catchtap="plugins_coupon_close_event">
<icon type="clear" size="20" />
</view>
</view>
<view qq:if="{{(plugins_coupon_data || null) != null && plugins_coupon_data.coupon_list.length > 0}}" class="coupon-container oh br-b">
<view class="not-use-tips tc">
<text bindtap="plugins_coupon_not_use_event">使</text>
</view>
<block qq:for="{{plugins_coupon_data.coupon_list}}" qq:key="item">
<view class="item spacing-mt bg-white" style="border:1px solid {{item.coupon.bg_color_value}};">
<view class="v-left fl">
<view class="base single-text" style="color:{{item.coupon.bg_color_value}};">
<text class="symbol"></text>
<text class="price">{{item.coupon.discount_value}}</text>
<text class="unit">{{item.coupon.type_unit}}</text>
<text qq:if="{{(item.coupon.desc || null) != null}}" class="desc cr-888">{{item.coupon.desc}}</text>
</view>
<view qq:if="{{(item.coupon.use_limit_type_name || null) != null}}" class="base-tips cr-666 single-text">{{item.coupon.use_limit_type_name}}</view>
<view class="base-time cr-888 single-text">{{item.time_start_text}} {{item.time_end_text}}</view>
</view>
<view class="v-right fr" style="background:{{item.coupon.bg_color_value}};" data-index="{{index}}" data-value="{{item.id}}" bindtap="plugins_coupon_use_event">
<text class="circle"></text>
<text>{{plugins_use_coupon_id == item.id ? '已选' : '选择'}}</text>
</view>
</view>
</block>
</view>
</view>
</component-popup>
</component-popup>
</block>

View File

@ -12,7 +12,7 @@
padding: 10rpx 35rpx 10rpx 10rpx;
}
.address-detail .icon {
width: 35rpx;
width: 30rpx;
height: 35rpx !important;
}
.address-detail .text {
@ -30,6 +30,13 @@
height: 85rpx;
line-height: 85rpx;
}
.address-alias {
border: 1px solid #d2364c;
color: #d2364c;
padding: 2rpx 10rpx;
border-radius: 6rpx;
margin-right: 10rpx;
}
/**
* 商品

View File

@ -22,31 +22,39 @@ Page({
},
init(e) {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
var msg = (user == false) ? '授权用户信息' : '绑定手机号码';
if (app.user_is_need_login(user)) {
qq.showModal({
title: '温馨提示',
content: msg,
confirmText: '确认',
cancelText: '暂不',
success: (result) => {
if (result.confirm) {
qq.navigateTo({
url: "/pages/login/login?event_callback=init"
});
} else {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
data_list_loding_msg: '请先' + msg,
});
}
},
});
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.showModal({
title: '温馨提示',
content: msg,
confirmText: '确认',
cancelText: '暂不',
success: (result) => {
if (result.confirm) {
qq.navigateTo({
url: "/pages/login/login?event_callback=init"
});
} else {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
data_list_loding_msg: '请先' + msg,
});
}
},
});
} else {
this.get_data();
}
} else {
this.get_data();
qq.stopPullDownRefresh();
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
data_list_loding_msg: '请先授权用户信息',
});
}
},
@ -87,7 +95,9 @@ Page({
data_bottom_line_status: false,
data_list_loding_msg: res.data.msg,
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'get_data')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {

View File

@ -79,6 +79,6 @@
</view>
<view qq:if="{{data_list.length == 0 && data_list_loding_status != 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>

View File

@ -5,13 +5,13 @@
</view>
<!-- 2 -->
<view wx:elif="{{status == 2}}" class="no-data-box tc">
<view qq:elif="{{status == 2}}" class="no-data-box tc">
<image src="/images/error.png" mode="widthFix" />
<view class="no-data-tips">{{msg || '处理错误'}}</view>
</view>
<!-- 0 -->
<view wx:elif="{{status == 0}}" class="no-data-box tc">
<view qq:elif="{{status == 0}}" class="no-data-box tc">
<image src="/images/empty.png" mode="widthFix" />
<view class="no-data-tips">{{msg || '没有相关数据'}}</view>
</view>

View File

@ -6,6 +6,10 @@ Page({
data_list_loding_msg: '',
data_list: [],
data_base: null,
// 优惠劵领取
temp_coupon_receive_index: null,
temp_coupon_receive_value: null,
},
onLoad(params) {
@ -80,45 +84,59 @@ Page({
// 优惠劵领取事件
coupon_receive_event(e) {
var user = app.get_user_cache_info(this, "coupon_receive_event");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=coupon_receive_event"
});
return false;
// 参数处理
if((e || null) == null)
{
var index = this.data.temp_coupon_receive_index;
var value = this.data.temp_coupon_receive_value;
} else {
var self = this;
var index = e.currentTarget.dataset.index;
var value = e.currentTarget.dataset.value;
var temp_list = this.data.data_list;
if (temp_list[index]['is_operable'] != 0) {
qq.showLoading({ title: "处理中..." });
qq.request({
url: app.get_request_url("receive", "coupon"),
method: "POST",
data: { "coupon_id": value },
dataType: "json",
header: { 'content-type': 'application/x-www-form-urlencoded' },
success: res => {
qq.hideLoading();
if (res.data.code == 0) {
app.showToast(res.data.msg, "success");
if (self.data.data_base != null && self.data.data_base.is_repeat_receive != 1)
{
temp_list[index]['is_operable'] = 0;
temp_list[index]['is_operable_name'] = '已领取';
self.setData({ data_list: temp_list });
}
} else {
app.showToast(res.data.msg);
}
},
fail: () => {
qq.hideLoading();
app.showToast("服务器请求出错");
}
this.setData({temp_coupon_receive_index: index, temp_coupon_receive_value: value});
}
// 登录校验
var user = app.get_user_info(this, 'coupon_receive_event');
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.navigateTo({
url: "/pages/login/login?event_callback=coupon_receive_event"
});
return false;
} else {
var self = this;
var temp_list = this.data.data_list;
if (temp_list[index]['is_operable'] != 0) {
qq.showLoading({ title: "处理中..." });
qq.request({
url: app.get_request_url("receive", "coupon"),
method: "POST",
data: { "coupon_id": value },
dataType: "json",
header: { 'content-type': 'application/x-www-form-urlencoded' },
success: res => {
qq.hideLoading();
if (res.data.code == 0) {
app.showToast(res.data.msg, "success");
if (self.data.data_base != null && self.data.data_base.is_repeat_receive != 1)
{
temp_list[index]['is_operable'] = 0;
temp_list[index]['is_operable_name'] = '已领取';
self.setData({ data_list: temp_list });
}
} else {
if (app.is_login_check(res.data, self, 'coupon_receive_event')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
qq.hideLoading();
app.showToast("服务器请求出错");
}
});
}
}
}
},

View File

@ -22,9 +22,9 @@
</view>
<view qq:if="{{data_list_loding_status != 3}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>

View File

@ -0,0 +1,146 @@
const app = getApp();
Page({
data: {
data_list_loding_status: 1,
data_bottom_line_status: false,
data_list: [],
params: null,
is_default: 0,
},
onLoad(params) {
this.setData({ params: params });
},
onShow() {
qq.setNavigationBarTitle({ title: app.data.common_pages_title.extraction_address });
this.init();
},
// 初始化
init() {
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取数据
this.get_data_list();
}
} else {
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
// 获取数据列表
get_data_list() {
// 加载loding
qq.showLoading({ title: "加载中..." });
this.setData({
data_list_loding_status: 1
});
// 获取数据
qq.request({
url: app.get_request_url("extraction", "useraddress"),
method: "POST",
data: {},
dataType: "json",
success: res => {
qq.hideLoading();
qq.stopPullDownRefresh();
if (res.data.code == 0) {
if (res.data.data.length > 0) {
// 获取当前默认地址
var is_default = 0;
for (var i in res.data.data) {
if (res.data.data[i]['is_default'] == 1) {
is_default = res.data.data[i]['id'];
}
}
// 设置数据
this.setData({
data_list: res.data.data,
is_default: is_default,
data_list_loding_status: 3,
data_bottom_line_status: true,
});
} else {
this.setData({
data_list_loding_status: 0
});
}
} else {
this.setData({
data_list_loding_status: 0
});
if (app.is_login_check(res.data, this, 'get_data_list')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
qq.hideLoading();
qq.stopPullDownRefresh();
this.setData({
data_list_loding_status: 2
});
app.showToast("服务器请求出错");
}
});
},
// 下拉刷新
onPullDownRefresh() {
this.get_data_list();
},
// 地图查看
address_map_event(e) {
var index = e.currentTarget.dataset.index || 0;
var ads = this.data.data_list[index] || null;
if (ads == null)
{
app.showToast("地址有误");
return false;
}
var lng = parseFloat(ads.lng || 0);
var lat = parseFloat(ads.lat || 0);
if (lng <= 0 || lat <= 0) {
app.showToast("坐标有误");
return false;
}
qq.openLocation({
latitude: lat,
longitude: lng,
scale: 18,
name: ads.alias || '',
address: (ads.province_name || '') + (ads.city_name || '') + (ads.county_name || '') + (ads.address || ''),
});
},
// 地址内容事件
address_conent_event(e) {
var index = e.currentTarget.dataset.index || 0;
var is_back = this.data.params.is_back || 0;
if (is_back == 1) {
qq.setStorage({
key: app.data.cache_buy_user_address_select_key,
data: this.data.data_list[index]
});
qq.navigateBack();
}
},
});

View File

@ -0,0 +1,3 @@
{
"enablePullDownRefresh": true
}

View File

@ -0,0 +1,28 @@
<view class="page">
<view qq:if="{{data_list.length > 0}}">
<view class="item bg-white spacing-mb" qq:for="{{data_list}}" qq:key="key">
<view bindtap="address_conent_event" data-index="{{index}}">
<view class="base oh">
<text qq:if="{{(item.alias || null) != null}}" class="address-alias">{{item.alias}}</text>
<text>{{item.name}}</text>
<text class="fr">{{item.tel}}</text>
</view>
<view class="address oh">
<image class="item-icon fl" src="/images/user-address.png" mode="widthFix" />
<view class="text fr">{{item.province_name}}{{item.city_name}}{{item.county_name}}{{item.address}}</view>
</view>
</view>
<view class="operation br-t oh">
<button qq:if="{{item.lng > 0 && item.lat > 0}}" class="fr cr-666 map-submit br" type="default" size="mini" bindtap="address_map_event" data-index="{{index}}" hover-class="none"></button>
</view>
</view>
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</view>

View File

@ -0,0 +1,24 @@
.item {
padding: 10rpx 10rpx 0 10rpx;
}
.base, .address, .operation {
padding: 20rpx 0;
}
.address .item-icon {
width: 30rpx;
height: 35rpx !important;
}
.address-alias {
border: 1px solid #d2364c;
color: #d2364c;
padding: 2rpx 10rpx;
border-radius: 6rpx;
margin-right: 10rpx;
}
.address .text {
line-height: 44rpx;
width: calc(100% - 40rpx);
}
.operation .map-submit {
margin-left: 20rpx;
}

View File

@ -17,7 +17,7 @@
</view>
<view qq:if="{{data_list.length == 0 && data_list_loding_status != 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}">
</template>
</view>

View File

@ -10,7 +10,7 @@
<view qq:if="{{item.portion > 0}}" class="progress-bar {{progress_class[index]}}" style="width: {{item.portion}}%;">{{item.name}}</view>
</block>
</block>
<text wx:else class="cr-888"></text>
<text qq:else class="cr-888"></text>
</view>
</view>
@ -41,10 +41,10 @@
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>

View File

@ -34,6 +34,7 @@ Page({
goods_video_is_autoplay: false,
common_app_is_use_mobile_detail: 1,
popup_share_status: false,
common_app_is_online_service: 0,
// 限时秒杀插件
@ -44,6 +45,18 @@ Page({
plugins_limitedtimediscount_timer: null,
plugins_limitedtimediscount_timers: null,
// 好物圈分享信息
common_app_is_good_thing : 0,
share_product: {
"item_code": "",
"title": "",
"desc": "",
"category_list": [],
"image_list": [],
"src_mini_program_path": "",
"brand_info": {},
},
// 海报分享
common_app_is_poster_share: 0,
@ -56,6 +69,10 @@ Page({
// 站点模式
common_site_type: 0,
customer_service_tel: null,
// 优惠劵领取
temp_coupon_receive_index: null,
temp_coupon_receive_value: null,
},
onLoad(params) {
@ -128,10 +145,21 @@ Page({
show_field_price_text: (data.goods.show_field_price_text == '销售价') ? null : (data.goods.show_field_price_text.replace(/<[^>]+>/g, "") || null),
common_app_is_use_mobile_detail: data.common_app_is_use_mobile_detail || 0,
//common_app_is_online_service: data.common_app_is_online_service || 0,
common_app_is_limitedtimediscount: data.common_app_is_limitedtimediscount || 0,
plugins_limitedtimediscount_data: data.plugins_limitedtimediscount_data || null,
common_app_is_good_thing: data.common_app_is_good_thing || 0,
'share_product.item_code': data.goods.id.toString(),
'share_product.title': data.goods.title,
'share_product.image_list': data.goods.photo.map(function (v) { return v.images;}),
'share_product.desc': data.goods.simple_desc,
'share_product.category_list': data.goods.category_names || [],
'share_product.src_mini_program_path': '/pages/goods-detail/goods-detail?goods_id='+data.goods.id,
'share_product.brand_info.name': data.goods.brand_name,
common_app_is_poster_share: data.common_app_is_poster_share || 0,
plugins_coupon_data: data.plugins_coupon_data || null,
quick_nav_cart_count: data.common_cart_total || 0,
});
@ -264,76 +292,84 @@ Page({
// 收藏事件
goods_favor_event(e)
{
var user = app.get_user_cache_info(this, 'goods_favor_event');
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.navigateTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
qq.showLoading({title: '处理中...'});
var user = app.get_user_info(this, 'goods_favor_event');
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.navigateTo({
url: "/pages/login/login?event_callback=goods_favor_event"
});
return false;
} else {
qq.showLoading({title: '处理中...'});
qq.request({
url: app.get_request_url('favor', 'goods'),
method: 'POST',
data: {"id": this.data.goods.id},
dataType: 'json',
success: (res) => {
qq.hideLoading();
if(res.data.code == 0)
{
this.setData({
'goods.is_favor': res.data.data.status,
goods_favor_text: res.data.data.text,
goods_favor_icon: '/images/goods-detail-favor-icon-'+res.data.data.status+'.png'
});
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
qq.request({
url: app.get_request_url('favor', 'goods'),
method: 'POST',
data: {"id": this.data.goods.id},
dataType: 'json',
success: (res) => {
qq.hideLoading();
if(res.data.code == 0)
{
this.setData({
'goods.is_favor': res.data.data.status,
goods_favor_text: res.data.data.text,
goods_favor_icon: '/images/goods-detail-favor-icon-'+res.data.data.status+'.png'
});
app.showToast(res.data.msg, "success");
} else {
if (app.is_login_check(res.data, this, 'goods_favor_event')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
qq.hideLoading();
app.showToast('服务器请求出错');
}
},
fail: () => {
qq.hideLoading();
app.showToast('服务器请求出错');
}
});
});
}
}
},
// 加入购物车事件
goods_cart_event(e, spec) {
var user = app.get_user_cache_info(this, 'goods_buy_confirm_event');
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.navigateTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
qq.showLoading({title: '处理中...' });
qq.request({
url: app.get_request_url('save', 'cart'),
method: 'POST',
data: { "goods_id": this.data.goods.id, "stock": this.data.temp_buy_number, "spec": JSON.stringify(spec) },
dataType: 'json',
success: (res) => {
qq.hideLoading();
if (res.data.code == 0) {
this.setData({ quick_nav_cart_count: res.data.data});
this.popup_close_event();
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
}
},
fail: () => {
qq.hideLoading();
goods_cart_event(spec) {
var user = app.get_user_info(this, 'goods_buy_confirm_event');
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.navigateTo({
url: "/pages/login/login?event_callback=goods_buy_confirm_event"
});
return false;
} else {
qq.showLoading({title: '处理中...' });
qq.request({
url: app.get_request_url('save', 'cart'),
method: 'POST',
data: { "goods_id": this.data.goods.id, "stock": this.data.temp_buy_number, "spec": JSON.stringify(spec) },
dataType: 'json',
success: (res) => {
qq.hideLoading();
if (res.data.code == 0) {
this.setData({ quick_nav_cart_count: res.data.data});
this.popup_close_event();
app.showToast(res.data.msg, "success");
} else {
if (app.is_login_check(res.data, this, 'goods_buy_confirm_event')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
qq.hideLoading();
app.showToast('服务器请求出错');
}
});
app.showToast('服务器请求出错');
}
});
}
}
},
@ -565,62 +601,64 @@ Page({
// 确认
goods_buy_confirm_event(e) {
var user = app.get_user_cache_info(this, 'goods_buy_confirm_event');
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.navigateTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 属性
var temp_data = this.data.goods_specifications_choose;
var sku_count = temp_data.length;
var active_count = 0;
var spec = [];
if(sku_count > 0)
{
for(var i in temp_data)
var user = app.get_user_info(this, 'goods_buy_confirm_event');
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.navigateTo({
url: "/pages/login/login?event_callback=goods_buy_confirm_event"
});
return false;
} else {
// 属性
var temp_data = this.data.goods_specifications_choose;
var sku_count = temp_data.length;
var active_count = 0;
var spec = [];
if(sku_count > 0)
{
for(var k in temp_data[i]['value'])
for(var i in temp_data)
{
if((temp_data[i]['value'][k]['is_active'] || null) != null)
for(var k in temp_data[i]['value'])
{
active_count++;
spec.push({"type": temp_data[i]['name'], "value": temp_data[i]['value'][k]['name']});
if((temp_data[i]['value'][k]['is_active'] || null) != null)
{
active_count++;
spec.push({"type": temp_data[i]['name'], "value": temp_data[i]['value'][k]['name']});
}
}
}
if(active_count < sku_count)
{
app.showToast('请选择属性');
return false;
}
}
if(active_count < sku_count)
{
app.showToast('请选择属性');
return false;
// 操作类型
switch (this.data.buy_event_type) {
case 'buy' :
// 进入订单确认页面
var data = {
"buy_type": "goods",
"goods_id": this.data.goods.id,
"stock": this.data.temp_buy_number,
"spec": JSON.stringify(spec)
};
qq.navigateTo({
url: '/pages/buy/buy?data=' + JSON.stringify(data)
});
this.popup_close_event();
break;
case 'cart' :
this.goods_cart_event(spec);
break;
default :
app.showToast("操作事件类型有误");
}
}
// 操作类型
switch (this.data.buy_event_type) {
case 'buy' :
// 进入订单确认页面
var data = {
"buy_type": "goods",
"goods_id": this.data.goods.id,
"stock": this.data.temp_buy_number,
"spec": JSON.stringify(spec)
};
qq.navigateTo({
url: '/pages/buy/buy?data=' + JSON.stringify(data)
});
this.popup_close_event();
break;
case 'cart' :
this.goods_cart_event(e, spec);
break;
default :
app.showToast("操作事件类型有误");
}
}
},
@ -659,6 +697,16 @@ Page({
this.setData({ goods_video_is_autoplay: false });
},
// 分享开启弹层
popup_share_event(e) {
this.setData({ popup_share_status: true });
},
// 分享弹层关闭
popup_share_close_event(e) {
this.setData({ popup_share_status: false });
},
// 显示秒杀插件-倒计时
plugins_limitedtimediscount_countdown() {
// 销毁之前的任务
@ -739,72 +787,32 @@ Page({
// 商品海报分享
poster_event() {
var user = app.get_user_cache_info(this, 'poster_event');
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.navigateTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
qq.showLoading({ title: '生成中...' });
qq.request({
url: app.get_request_url('poster', 'goods'),
method: 'POST',
data: { "goods_id": this.data.goods.id },
dataType: 'json',
success: (res) => {
qq.hideLoading();
if (res.data.code == 0) {
qq.previewImage({
current: res.data.data,
urls: [res.data.data]
});
} else {
app.showToast(res.data.msg);
}
},
fail: () => {
qq.hideLoading();
app.showToast("服务器请求出错");
}
});
}
},
// 优惠劵领取事件
coupon_receive_event(e) {
var user = app.get_user_cache_info(this, "coupon_receive_event");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=coupon_receive_event"
});
return false;
} else {
var self = this;
var index = e.currentTarget.dataset.index;
var value = e.currentTarget.dataset.value;
var temp_list = this.data.plugins_coupon_data.data;
if (temp_list[index]['is_operable'] != 0) {
qq.showLoading({ title: "处理中..." });
var user = app.get_user_info(this, 'poster_event');
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.navigateTo({
url: "/pages/login/login?event_callback=poster_event"
});
return false;
} else {
qq.showLoading({ title: '生成中...' });
qq.request({
url: app.get_request_url("receive", "coupon"),
method: "POST",
data: { "coupon_id": value },
dataType: "json",
header: { 'content-type': 'application/x-www-form-urlencoded' },
success: res => {
url: app.get_request_url('poster', 'goods'),
method: 'POST',
data: { "goods_id": this.data.goods.id },
dataType: 'json',
success: (res) => {
qq.hideLoading();
if (res.data.code == 0) {
app.showToast(res.data.msg, "success");
if (self.data.plugins_coupon_data.base != null && self.data.plugins_coupon_data.base.is_repeat_receive != 1) {
temp_list[index]['is_operable'] = 0;
temp_list[index]['is_operable_name'] = '已领取';
self.setData({ 'plugins_coupon_data.data': temp_list });
}
qq.previewImage({
current: res.data.data,
urls: [res.data.data]
});
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'poster_event')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
@ -816,6 +824,64 @@ Page({
}
},
// 优惠劵领取事件
coupon_receive_event(e) {
// 参数处理
if((e || null) == null)
{
var index = this.data.temp_coupon_receive_index;
var value = this.data.temp_coupon_receive_value;
} else {
var index = e.currentTarget.dataset.index;
var value = e.currentTarget.dataset.value;
this.setData({temp_coupon_receive_index: index, temp_coupon_receive_value: value});
}
// 登录校验
var user = app.get_user_info(this, 'coupon_receive_event');
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.navigateTo({
url: "/pages/login/login?event_callback=coupon_receive_event"
});
return false;
} else {
var self = this;
var temp_list = this.data.plugins_coupon_data.data;
if (temp_list[index]['is_operable'] != 0) {
qq.showLoading({ title: "处理中..." });
qq.request({
url: app.get_request_url("receive", "coupon"),
method: "POST",
data: { "coupon_id": value },
dataType: "json",
header: { 'content-type': 'application/x-www-form-urlencoded' },
success: res => {
qq.hideLoading();
if (res.data.code == 0) {
app.showToast(res.data.msg, "success");
if (self.data.plugins_coupon_data.base != null && self.data.plugins_coupon_data.base.is_repeat_receive != 1) {
temp_list[index]['is_operable'] = 0;
temp_list[index]['is_operable_name'] = '已领取';
self.setData({ 'plugins_coupon_data.data': temp_list });
}
} else {
if (app.is_login_check(res.data, self, 'coupon_receive_event')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
qq.hideLoading();
app.showToast("服务器请求出错");
}
});
}
}
}
},
// 展示型事件
exhibition_submit_event(e) {
app.call_tel(this.data.customer_service_tel);
@ -823,7 +889,7 @@ Page({
// 自定义分享
onShareAppMessage() {
var user = app.get_user_cache_info(this, 'goods_favor_event') || null;
var user = app.get_user_cache_info() || null;
var user_id = (user != null && (user.id || null) != null) ? user.id : 0;
return {
title: app.data.application_title +'-'+ this.data.goods.title,
@ -831,5 +897,4 @@ Page({
path: '/pages/goods-detail/goods-detail?goods_id=' + this.data.goods.id +'&referrer='+user_id
};
},
});

View File

@ -31,7 +31,7 @@
<!-- -->
<view qq:if="{{common_app_is_limitedtimediscount == 1 && plugins_limitedtimediscount_data != null}}">
<import src="/pages/lib/limitedtimediscount/goods-detail.wxml" />
<import src="/pages/lib/limitedtimediscount/goods-detail.qml" />
<template is="limitedtimediscount" data="{{plugins_limitedtimediscount_data: plugins_limitedtimediscount_data, plugins_limitedtimediscount_is_show_time: plugins_limitedtimediscount_is_show_time, plugins_limitedtimediscount_time_millisecond: plugins_limitedtimediscount_time_millisecond}}"></template>
</view>
@ -42,7 +42,7 @@
<button type="default" size="mini" open-type="share" hover-class="none">
<image src="/images/goods-detail-share-icon.png" mode="scaleToFill" class="dis-block" />
<view class="cr-888"></view>
</button>
</button>
</view>
<text qq:if="{{(show_field_price_text || null) != null}}" class="price-icon">{{show_field_price_text}}</text>
<text class="sales-price">{{goods.price}}</text>
@ -118,7 +118,7 @@
</view>
<!-- 线 -->
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
<!-- -->
@ -132,7 +132,7 @@
<text class="dis-block cr-888">{{goods_favor_text}}</text>
</view>
<view class="fr {{common_site_type == 1 ? 'exhibition-mode' : ''}}">
<!-- -->
<!-- 1 -->
<block qq:if="{{common_site_type == 1}}">
<button class="bg-main fl" type="default" bindtap="exhibition_submit_event" hover-class="none">{{nav_submit_text}}</button>
</block>
@ -201,13 +201,13 @@
</view>
<view qq:if="{{goods == null}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<!-- 线 -->
<view qq:if="{{common_app_is_online_service == 1}}">
<import src="/pages/lib/online-service/content.wxml" />
<import src="/pages/lib/online-service/content.qml" />
<template is="online_service"></template>
</view>

View File

@ -28,11 +28,11 @@
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>

View File

@ -20,7 +20,7 @@
<!-- -->
<view qq:if="{{common_app_is_limitedtimediscount == 1}}">
<import src="/pages/lib/limitedtimediscount/home.wxml" />
<import src="/pages/lib/limitedtimediscount/home.qml" />
<template is="limitedtimediscount" data="{{plugins_limitedtimediscount_data: plugins_limitedtimediscount_data, plugins_limitedtimediscount_is_show_time: plugins_limitedtimediscount_is_show_time, plugins_limitedtimediscount_timer_title: plugins_limitedtimediscount_timer_title}}"></template>
</view>
@ -60,7 +60,7 @@
</view>
</block>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
@ -72,17 +72,17 @@
</view>
<!-- -->
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
<!-- 线 -->
<view qq:if="{{common_app_is_online_service == 1}}">
<import src="/pages/lib/online-service/content.wxml" />
<import src="/pages/lib/online-service/content.qml" />
<template is="online_service"></template>
</view>
<!-- -->
<view qq:if="{{load_status == 1}}">
<import src="/pages/common/copyright.wxml" />
<import src="/pages/common/copyright.qml" />
<template is="copyright"></template>
</view>

View File

@ -24,9 +24,6 @@ Page({
// 标题设置
qq.setNavigationBarTitle({ title: (this.data.user == null) ? '授权用户信息' : '手机绑定' });
// 用户授权
app.user_login();
},
/**

View File

@ -14,16 +14,23 @@ Page({
},
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取数据
this.get_data_list();
}
} else {
// 获取数据
this.get_data_list();
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
@ -91,8 +98,9 @@ Page({
this.setData({
data_list_loding_status: 0
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'get_data_list')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {

View File

@ -8,16 +8,16 @@
<view class="data-detail">{{item.detail}}</view>
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}">
</template>
</view>

View File

@ -1,6 +1,6 @@
<view class="content">
<image class="pay-icon" qq:if="{{params.code == '9000'}}" mode="widthFix" src="{{default_round_success_icon}}" />
<image class="pay-icon" wx:else mode="widthFix" src="{{default_round_error_icon}}" />
<image class="pay-icon" qq:else mode="widthFix" src="{{default_round_error_icon}}" />
<text class="dis-block">{{params.msg}}</text>
<view qq:if="{{params.code == '9000'}}" class="price-box">
<text class="sales-price">{{params.total_price}}</text>

View File

@ -37,26 +37,37 @@ Page({
},
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取地址数据
if((this.data.params.id || null) != null)
{
this.get_user_address();
}
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: '请先绑定手机号码',
});
return false;
} else {
// 获取地址数据
if((this.data.params.id || null) != null)
{
this.get_user_address();
}
// 获取省
this.get_province_list();
// 获取省
this.get_province_list();
}
} else {
this.setData({
data_list_loding_status: 2,
data_list_loding_msg: '请先授权用户信息',
});
}
},
// 获取用户地址
// 获取用户地址
get_user_address() {
var self = this;
// 加载loding
@ -89,7 +100,9 @@ Page({
self.init_value();
}, 500);
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
@ -289,7 +302,11 @@ Page({
qq.navigateBack();
}, 1000);
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -19,16 +19,23 @@ Page({
// 初始化
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取数据
this.get_data_list();
}
} else {
// 获取数据
this.get_data_list();
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
@ -77,8 +84,9 @@ Page({
this.setData({
data_list_loding_status: 0
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'get_data_list')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
@ -149,7 +157,11 @@ Page({
}
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {
@ -196,7 +208,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -14,7 +14,7 @@
<view class="operation br-t oh">
<view class="default fl" bindtap="address_default_event" data-value="{{item.id}}">
<image qq:if="{{is_default == item.id}}" class="item-icon" src="/images/default-select-active-icon.png" mode="widthFix" />
<image wx:else class="item-icon" src="/images/default-select-icon.png" mode="widthFix" />
<image qq:else class="item-icon" src="/images/default-select-icon.png" mode="widthFix" />
<text></text>
</view>
<button class="fr cr-666 delete-submit br" type="default" size="mini" bindtap="address_delete_event" data-index="{{index}}" data-value="{{item.id}}" hover-class="none"></button>
@ -26,11 +26,11 @@
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
<navigator url="/pages/user-address-save/user-address-save" open-type="navigate" hover-class="none">

View File

@ -16,16 +16,23 @@ Page({
},
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取数据
this.get_data_list();
}
} else {
// 获取数据
this.get_data_list();
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
@ -91,8 +98,9 @@ Page({
this.setData({
data_list_loding_status: 0
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'get_data_list')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {

View File

@ -13,10 +13,10 @@
</view>
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>

View File

@ -23,16 +23,23 @@ Page({
},
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取数据
this.get_data_list();
}
} else {
// 获取数据
this.get_data_list();
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
@ -66,7 +73,9 @@ Page({
data_list_loding_status: 2,
data_list_loding_msg: res.data.msg,
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, self, 'get_data_list')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {

View File

@ -78,10 +78,10 @@
</view>
<view qq:if="{{data_list_loding_status != 3}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>

View File

@ -14,16 +14,23 @@ Page({
},
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取数据
this.get_data_list();
}
} else {
// 获取数据
this.get_data_list();
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
@ -89,8 +96,9 @@ Page({
this.setData({
data_list_loding_status: 0
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'get_data_list')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
@ -156,7 +164,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -15,9 +15,9 @@
</view>
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>

View File

@ -14,16 +14,23 @@ Page({
},
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取数据
this.get_data_list();
}
} else {
// 获取数据
this.get_data_list();
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
@ -88,8 +95,9 @@ Page({
this.setData({
data_list_loding_status: 0
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'get_data_list')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
@ -154,7 +162,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -15,9 +15,9 @@
</view>
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>

View File

@ -14,16 +14,23 @@ Page({
},
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取数据
this.get_data_list();
}
} else {
// 获取数据
this.get_data_list();
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
@ -91,8 +98,9 @@ Page({
this.setData({
data_list_loding_status: 0
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'get_data_list')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {

View File

@ -2,7 +2,7 @@
<view class="content">
<view class="data-card bg-white br-b" qq:for="{{data_list}}">
<view class="data-box oh">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<text class="data-title">{{item.type_name}}</text>
<text class="data-time fr">{{item.add_time_time}}</text>
</view>
@ -13,16 +13,16 @@
<view class="data-detail">{{item.msg}}</view>
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
</view>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</scroll-view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}">
</template>
</view>

View File

@ -41,6 +41,6 @@
</view>
<view qq:if="{{detail == null}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>

View File

@ -9,9 +9,11 @@ Page({
detail: null,
detail_list: [],
extension_data: [],
site_fictitious: null,
},
onLoad(params) {
//params['id'] = 5;
this.setData({params: params});
this.init();
},
@ -40,29 +42,31 @@ Page({
if (res.data.code == 0) {
var data = res.data.data;
self.setData({
detail: data,
detail: data.data,
detail_list:[
{name: "订单号", value: data.order_no || ''},
{name: "状态", value: data.status_name || ''},
{name: "支付状态", value: data.pay_status_name || ''},
{name: "单价", value: data.price || ''},
{name: "总价", value: data.total_price || ''},
{name: "优惠金额", value: data.preferential_price || ''},
{name: "增加金额", value: data.increase_price || '' },
{name: "支付金额", value: data.pay_price || ''},
{name: "支付方式", value: data.payment_name || ''},
{name: "快递公司", value: data.express_name || ''},
{name: "快递单号", value: data.express_number || ''},
{name: "用户留言", value: data.user_note || ''},
{name: "创建时间", value: data.add_time || ''},
{name: "确认时间", value: data.confirm_time || ''},
{name: "支付时间", value: data.pay_time || ''},
{name: "发货时间", value: data.delivery_time || ''},
{name: "收货时间", value: data.collect_time || ''},
{name: "取消时间", value: data.close_time || ''},
{name: "关闭时间", value: data.close_time || ''},
{name: "订单号", value: data.data.order_no || ''},
{name: "订单模式", value: data.data.order_model_name || '' },
{name: "状态", value: data.data.status_name || ''},
{name: "支付状态", value: data.data.pay_status_name || ''},
{name: "单价", value: data.data.price || ''},
{name: "总价", value: data.data.total_price || ''},
{name: "优惠金额", value: data.data.preferential_price || ''},
{name: "增加金额", value: data.data.increase_price || '' },
{name: "支付金额", value: data.data.pay_price || ''},
{name: "支付方式", value: data.data.payment_name || ''},
{name: "快递公司", value: data.data.express_name || ''},
{name: "快递单号", value: data.data.express_number || ''},
{name: "用户留言", value: data.data.user_note || ''},
{name: "创建时间", value: data.data.add_time || ''},
{name: "确认时间", value: data.data.confirm_time || ''},
{name: "支付时间", value: data.data.pay_time || ''},
{name: "发货时间", value: data.data.delivery_time || ''},
{name: "收货时间", value: data.data.collect_time || ''},
{name: "取消时间", value: data.data.close_time || ''},
{name: "关闭时间", value: data.data.close_time || ''},
],
extension_data: data.extension_data || [],
extension_data: data.data.extension_data || [],
site_fictitious: data.site_fictitious || null,
data_list_loding_status: 3,
data_bottom_line_status: true,
data_list_loding_msg: '',
@ -73,7 +77,9 @@ Page({
data_bottom_line_status: false,
data_list_loding_msg: res.data.msg,
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, self, 'init')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
@ -90,6 +96,31 @@ Page({
});
},
// 地图查看
address_map_event(e) {
if ((this.data.detail.address_data || null) == null)
{
app.showToast("地址有误");
return false;
}
var ads = this.data.detail.address_data;
var lng = parseFloat(ads.lng || 0);
var lat = parseFloat(ads.lat || 0);
if (lng <= 0 || lat <= 0) {
app.showToast("坐标有误");
return false;
}
qq.openLocation({
latitude: lat,
longitude: lng,
scale: 18,
name: ads.alias || '',
address: (ads.province_name || '') + (ads.city_name || '') + (ads.county_name || '') + (ads.address || ''),
});
},
// 下拉刷新
onPullDownRefresh() {
this.init();

View File

@ -1,17 +1,23 @@
<view qq:if="{{detail != null}}">
<view class="address bg-white spacing-mb">
<!-- -->
<view qq:if="{{detail.order_model == 0 || detail.order_model == 2}}" class="address bg-white spacing-mb">
<view class="address-base oh">
<text>{{detail.receive_name}}</text>
<text class="fr">{{detail.receive_tel}}</text>
<text qq:if="{{(detail.address_data.alias || null) != null}}" class="address-alias">{{detail.address_data.alias}}</text>
<text>{{detail.address_data.name}}</text>
<text class="fr">{{detail.address_data.tel}}</text>
</view>
<view class="address-detail oh">
<image class="icon fl" src="/images/user-address.png" mode="widthFix" />
<view class="text fr">{{detail.receive_province_name}}{{detail.receive_city_name}}{{detail.receive_county_name}}{{detail.receive_address}}</view>
<view class="text fr">
{{detail.address_data.province_name}}{{detail.address_data.city_name}}{{detail.address_data.county_name}}{{detail.address_data.address}}
<text qq:if="{{detail.order_model == 2 && (detail.address_data.lng || 0) > 0 && (detail.address_data.lat || 0) > 0}}" class="cr-666 br address-map-submit" bindtap="address_map_event"></text>
</view>
</view>
</view>
<!-- -->
<view class="goods bg-white spacing-mb">
<view qq:for="{{detail.items}}" qq:key="item" class="goods-item oh">
<view qq:for="{{detail.items}}" qq:key="item" class="goods-item br-b-dashed oh">
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods_id}}" hover-class="none">
<image class="goods-image fl" src="{{item.images}}" mode="aspectFill" />
<view class="goods-base">
@ -29,30 +35,66 @@
</view>
</navigator>
</view>
<view class="order-describe">{{detail.describe}}</view>
</view>
<!-- -->
<view qq:if="{{detail.order_model == 3 && detail.pay_status == 1 && (detail.status == 3 || detail.status == 4)}}" class="panel-item spacing-mt site-fictitious">
<view class="panel-title">{{site_fictitious.title || '密钥信息'}}</view>
<view class="panel-content bg-white oh">
<view qq:if="{{(site_fictitious.tips || null) != null}}" class="tips-value">
<rich-text nodes="{{site_fictitious.tips}}"></rich-text>
</view>
<view qq:for="{{detail.items}}" qq:key="item" class="item br-b-dashed oh">
<image class="left-image br fl" src="{{item.images}}" mode="aspectFill" />
<view class="right-value fr">
<rich-text qq:if="{{(item.fictitious_goods_value || null) != null}}" nodes="{{item.fictitious_goods_value}}"></rich-text>
<text qq:else class="cr-888"></text>
</view>
</view>
</view>
</view>
<!-- -->
<view qq:if="{{detail.order_model == 2 && (detail.status == 2 || detail.status == 3) && (detail.extraction_data || null) != null}}" class="panel-item spacing-mt site-extraction">
<view class="panel-title"></view>
<view class="panel-content bg-white oh">
<view>
<text></text>
<text class="code">{{detail.extraction_data.code || '取货码不存在、请联系管理员'}}</text>
</view>
<image qq:if="{{(detail.extraction_data.images || null) != null}}" class="br qrcode" src="{{detail.extraction_data.images}}" mode="aspectFill" />
</view>
</view>
<!-- -->
<view qq:if="{{detail_list.length > 0}}" class="detail-list bg-white">
<view qq:for="{{detail_list}}" qq:key="item" class="item br-b oh">
<view class="title fl">{{item.name}}</view>
<view class="content cr-888 fl br-l">{{item.value}}</view>
<view qq:if="{{detail_list.length > 0}}" class="panel-item spacing-mt">
<view class="panel-title"></view>
<view class="panel-content bg-white">
<view qq:for="{{detail_list}}" qq:key="item" class="item br-b oh">
<view class="title fl">{{item.name}}</view>
<view class="content cr-888 fl br-l">{{item.value}}</view>
</view>
</view>
</view>
<!-- -->
<view qq:if="{{extension_data.length > 0}}" class="extension-list bg-white spacing-mt">
<view qq:for="{{extension_data}}" qq:key="item" class="item br-b oh">
<view qq:if="{{extension_data.length > 0}}" class="panel-item spacing-mt extension-list">
<view class="panel-title"></view>
<view class="panel-content bg-white">
<view qq:for="{{extension_data}}" qq:key="item" class="item br-b oh">
<text class="title">{{item.name}}</text>
<text class="content cr-888 br-l">{{item.tips}}</text>
</view>
</view>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</view>
<view qq:if="{{detail == null}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>

View File

@ -1,3 +1,6 @@
/*
* 地址信息
*/
.address {
padding: 10rpx;
}
@ -5,7 +8,7 @@
padding: 10rpx 35rpx 10rpx 10rpx;
}
.address-detail .icon {
width: 35rpx;
width: 30rpx;
height: 35rpx !important;
}
.address-detail .text {
@ -23,13 +26,23 @@
height: 85rpx;
line-height: 85rpx;
}
.address-alias {
border: 1px solid #d2364c;
color: #d2364c;
padding: 2rpx 10rpx;
border-radius: 6rpx;
margin-right: 10rpx;
}
/*
* 商品信息
*/
.goods-base {
min-height: 160rpx;
margin-left: 180rpx;
}
.goods .goods-item:not(:last-child) {
border-bottom: 1px dashed #efefef;
.goods .goods-item:last-child {
border-bottom: 0;
}
.goods-item {
padding: 20rpx 10rpx;
@ -50,26 +63,36 @@
right: 0;
bottom: 0;
}
.order-describe {
padding: 20rpx 10rpx;
}
/*
* 基础信息
* 面板信息
*/
.detail-list {
padding: 0 10rpx;
.panel-item .panel-title {
background: #fff;
font-weight: bold;
padding: 15rpx;
border-bottom: 2px solid #eee;
font-size: 34rpx;
}
.detail-list .item {
.panel-item .panel-content .item {
padding: 20rpx 0;
}
.detail-list .item .title {
.panel-item .panel-content .item:last-child {
border: 0;
}
.panel-item .panel-content .item .title {
width: 25%;
padding-left: 20rpx;
}
.detail-list .item .content {
.panel-item .panel-content .item .content {
width: calc(75% - 50rpx);
padding-left: 20rpx;
min-height: 46rpx;
}
.detail-list .item view {
.panel-item .panel-content .item view {
line-height: 46rpx;
}
@ -84,4 +107,50 @@
}
.extension-list .item .content {
padding-left: 20rpx;
}
/*
* 虚拟销售信息
*/
.site-fictitious .panel-content {
padding: 0 20rpx;
}
.site-fictitious .panel-content .tips-value {
color: #f37b1d;
background-color: #fff2e9;
border-color: #ffebdb;
padding: 10rpx;
margin-top: 20rpx;
}
.site-fictitious .panel-content .left-image {
width: 80rpx;
height: 80rpx;
}
.site-fictitious .panel-content .right-value {
width: calc(100% - 100rpx);
}
/*
* 自提信息
*/
.site-extraction .panel-content {
padding: 20rpx;
}
.site-extraction .panel-content .code {
background: #5eb95e;
color: #fff;
}
.site-extraction .panel-content .code,
.address-map-submit {
padding: 1rpx 16rpx;
border-radius: 6rpx;
}
.site-extraction .panel-content .qrcode {
margin-top: 15rpx;
width: 300rpx;
height: 300rpx;
}
.address-map-submit {
margin-left: 20rpx;
background: #f5f5f5;
}

View File

@ -49,16 +49,23 @@ Page({
},
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
var user = app.get_user_info(this, 'init');
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取数据
this.get_data_list();
}
} else {
// 获取数据
this.get_data_list();
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
@ -156,8 +163,9 @@ Page({
data_list_loding_status: 0,
load_status: 1,
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'get_data_list')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
@ -227,21 +235,20 @@ Page({
if (res.data.code == 0) {
// 是否在线支付,非在线支付则支付成功
if (res.data.data.is_online_pay == 0) {
var temp_data_list = this.data.data_list;
temp_data_list[index]['status'] = 2;
temp_data_list[index]['status_name'] = '待发货';
this.setData({ data_list: temp_data_list });
// 数据设置
self.order_item_pay_success_handle(index);
app.showToast("支付成功", "success");
} else {
qq.requestPayment({
package: res.data.data.data,
timeStamp: res.data.data.data.timeStamp,
nonceStr: res.data.data.data.nonceStr,
package: res.data.data.data.package,
signType: res.data.data.data.signType,
paySign: res.data.data.data.paySign,
success: function(res) {
// 数据设置
var temp_data_list = self.data.data_list;
temp_data_list[index]['status'] = 2;
temp_data_list[index]['status_name'] = '待发货';
self.setData({ data_list: temp_data_list });
self.order_item_pay_success_handle(index);
// 跳转支付页面
qq.navigateTo({
@ -265,6 +272,32 @@ Page({
});
},
// 支付成功数据设置
order_item_pay_success_handle(index) {
// 数据设置
var temp_data_list = this.data.data_list;
switch (parseInt(temp_data_list[index]['order_model'])) {
// 销售模式
case 0:
temp_data_list[index]['status'] = 2;
temp_data_list[index]['status_name'] = '待发货';
break;
// 自提模式
case 2:
temp_data_list[index]['status'] = 2;
temp_data_list[index]['status_name'] = '待取货';
break;
// 虚拟模式
case 3:
temp_data_list[index]['status'] = 3;
temp_data_list[index]['status_name'] = '待收货';
break;
}
this.setData({ data_list: temp_data_list });
},
// 取消
cancel_event(e) {
qq.showModal({

View File

@ -2,7 +2,7 @@
<view class="nav">
<block qq:for="{{nav_status_list}}" qq:key="key">
<view qq:if="{{nav_status_index == index}}" class="item fl tc cr-main" data-index="{{index}}" bindtap="nav_event">{{item.name}}</view>
<view wx:else class="item fl tc" data-index="{{index}}" bindtap="nav_event">{{item.name}}</view>
<view qq:else class="item fl tc" data-index="{{index}}" bindtap="nav_event">{{item.name}}</view>
</block>
</view>
@ -14,7 +14,7 @@
<text class="cr-666">{{item.add_time}}</text>
<text class="fr cr-main">{{item.status_name}}</text>
</view>
<view qq:for="{{item.items}}" qq:key="key" qq:for-item="detail" class="goods-item oh">
<view qq:for="{{item.items}}" qq:key="key" qq:for-item="detail" class="goods-item br-b-dashed oh">
<navigator url="/pages/user-order-detail/user-order-detail?id={{item.id}}" hover-class="none">
<image class="goods-image fl" src="{{detail.images}}" mode="aspectFill" />
<view class="goods-base">
@ -34,22 +34,22 @@
</navigator>
</view>
<view class="item-describe tr cr-666">{{item.describe}}</view>
<view qq:if="{{item.status <= 3 || (item.status == 4 && item.user_is_comments == 0)}}" class="item-operation tr br-t">
<view qq:if="{{item.status == 1 || item.status == 3 || (item.status == 4 && item.user_is_comments == 0) || (item.status == 2 && item.order_model != 2)}}" class="item-operation tr br-t">
<button qq:if="{{item.status <= 1}}" class="submit-cancel" type="default" size="mini" bindtap="cancel_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none"></button>
<button qq:if="{{item.status == 1}}" class="submit-pay cr-666 br" type="default" size="mini" bindtap="pay_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none"></button>
<button qq:if="{{item.status == 2}}" class="submit-rush cr-666 br" type="default" size="mini" bindtap="rush_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none"></button>
<button qq:if="{{item.status == 2 && item.order_model != 2}}" class="submit-rush cr-666 br" type="default" size="mini" bindtap="rush_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none"></button>
<button qq:if="{{item.status == 3}}" class="submit-success cr-666 br" type="default" size="mini" bindtap="collect_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none"></button>
<button qq:if="{{item.status == 4 && item.user_is_comments == 0}}" class="submit-success cr-666 br" type="default" size="mini" bindtap="comments_event" data-value="{{item.id}}" data-index="{{index}}" hover-class="none"></button>
</view>
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status}}">
</template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</view>
</scroll-view>
@ -65,5 +65,5 @@
</view>
</view>
</view>
<view wx:else class="payment-list oh bg-white tc cr-888"></view>
<view qq:else class="payment-list oh bg-white tc cr-888"></view>
</component-popup>

View File

@ -24,8 +24,8 @@
.goods-title {
line-height: 36rpx;
}
.list-item .goods-item:not(:last-child) {
border-bottom: 1px dashed #efefef;
.list-item .goods-item:last-child {
border-bottom: 0;
}
.goods-item {
padding: 20rpx 10rpx;

View File

@ -165,8 +165,8 @@
</component-popup>
</view>
<view qq:if="{{order_data == null}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template qq:if="{{new_aftersale_data != null && new_aftersale_data.status != 5}}" is="bottom_line" data="{{status: data_bottom_line_status}}"></template>

View File

@ -51,16 +51,23 @@ Page({
},
init() {
var user = app.get_user_cache_info(this, "init");
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
var user = app.get_user_info(this, "init");
if (user != false) {
// 用户未绑定用户则转到登录页面
if (app.user_is_need_login(user)) {
qq.redirectTo({
url: "/pages/login/login?event_callback=init"
});
return false;
} else {
// 获取数据
this.get_data_list();
}
} else {
// 获取数据
this.get_data_list();
this.setData({
data_list_loding_status: 0,
data_bottom_line_status: false,
});
}
},
@ -134,8 +141,9 @@ Page({
data_list_loding_status: 0,
data_list_loding_msg: res.data.msg,
});
app.showToast(res.data.msg);
if (app.is_login_check(res.data, this, 'get_data_list')) {
app.showToast(res.data.msg);
}
}
},
fail: () => {
@ -209,7 +217,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -2,7 +2,7 @@
<view class="nav">
<block qq:for="{{nav_status_list}}" qq:key="key">
<view qq:if="{{nav_status_index == index}}" class="item fl tc cr-main" data-index="{{index}}" bindtap="nav_event">{{item.name}}</view>
<view wx:else class="item fl tc" data-index="{{index}}" bindtap="nav_event">{{item.name}}</view>
<view qq:else class="item fl tc" data-index="{{index}}" bindtap="nav_event">{{item.name}}</view>
</block>
</view>
@ -49,12 +49,12 @@
</view>
<view qq:if="{{data_list.length == 0}}">
<import src="/pages/common/nodata.wxml" />
<import src="/pages/common/nodata.qml" />
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}">
</template>
</view>
<import src="/pages/common/bottom_line.wxml" />
<import src="/pages/common/bottom_line.qml" />
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
</view>
</scroll-view>

View File

@ -107,7 +107,10 @@ Page({
common_app_is_head_vice_nav: data.common_app_is_head_vice_nav || 0,
});
} else {
app.showToast(res.data.msg);
if(app.is_login_check(res.data, this, 'get_data'))
{
app.showToast(res.data.msg);
}
}
},
fail: () => {

View File

@ -74,10 +74,10 @@
<!-- 线 -->
<view qq:if="{{common_app_is_online_service == 1}}">
<import src="/pages/lib/online-service/content.wxml" />
<import src="/pages/lib/online-service/content.qml" />
<template is="online_service"></template>
</view>
<!-- -->
<import src="/pages/common/copyright.wxml" />
<import src="/pages/common/copyright.qml" />
<template is="copyright"></template>

View File

@ -889,7 +889,7 @@ Page({
// 自定义分享
onShareAppMessage() {
var user = app.get_user_cache_info(this, 'goods_favor_event') || null;
var user = app.get_user_cache_info() || null;
var user_id = (user != null && (user.id || null) != null) ? user.id : 0;
return {
title: app.data.application_title +'-'+ this.data.goods.title,

View File

@ -157,7 +157,11 @@ Page({
}
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {
@ -204,7 +208,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -164,7 +164,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -162,7 +162,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {

View File

@ -217,7 +217,11 @@ Page({
app.showToast(res.data.msg, "success");
} else {
app.showToast(res.data.msg);
if (app.is_login_check(res.data)) {
app.showToast(res.data.msg);
} else {
app.showToast('提交失败,请重试!');
}
}
},
fail: () => {