mirror of
https://gitee.com/zongzhige/shopxo.git
synced 2026-07-08 14:40:03 +08:00
小程序新增积分商城
This commit is contained in:
@ -75,7 +75,8 @@
|
||||
"pages/plugins/signin/user-qrcode/user-qrcode",
|
||||
"pages/plugins/signin/user-qrcode-detail/user-qrcode-detail",
|
||||
"pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo",
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list"
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list",
|
||||
"pages/plugins/points/index/index"
|
||||
],
|
||||
"window": {
|
||||
"defaultTitle": "{{application_title}}",
|
||||
|
||||
@ -20,6 +20,12 @@
|
||||
margin-top: 5rpx;
|
||||
}
|
||||
.data-list .items .title {
|
||||
margin-top: 10rpx;
|
||||
font-size: 32rpx;
|
||||
margin-top: 10rpx;
|
||||
font-size: 30rpx;
|
||||
text-align:center;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
max-width: 100%;
|
||||
}
|
||||
@ -180,10 +180,10 @@
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 插件样式区域
|
||||
*/
|
||||
/**
|
||||
/*
|
||||
* 优惠劵
|
||||
*/
|
||||
.plugins-coupon {
|
||||
@ -209,4 +209,24 @@
|
||||
.coupon-container .not-use-tips {
|
||||
color: #f7b240;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 积分
|
||||
*/
|
||||
.plugins-points-buy-container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.plugins-points-buy-container .select .icon {
|
||||
width: 45rpx;
|
||||
height: 45rpx !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.plugins-points-buy-container .select .sales-price {
|
||||
margin-left: 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
.plugins-points-buy-container .desc {
|
||||
color: #F37B1D;
|
||||
}
|
||||
@ -90,6 +90,22 @@
|
||||
<view a:else onTap="bind_user_note_tap_event" class="{{(user_note_value || null) == null ? 'cr-888' : ''}}">{{user_note_value || '留言'}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 积分 -->
|
||||
<view a:if="{{(plugins_points_data || null) != null && (plugins_points_data.discount_price || 0) > 0}}" class="plugins-points-buy-container bg-white spacing-mb">
|
||||
<view class="select oh">
|
||||
<text a:if="{{plugins_points_data.discount_type == 1}}">使用{{plugins_points_data.use_integral}}个积分兑换商品</text>
|
||||
<text a:else>使用积分{{plugins_points_data.use_integral}}个</text>
|
||||
<text class="sales-price">-{{currency_symbol}}{{plugins_points_data.discount_price}}</text>
|
||||
<view onTap="points_event" class="fr">
|
||||
<image class="icon" src="/images/default-select{{plugins_points_status ? '-active' : ''}}-icon.png" mode="widthFix" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<text a:if="{{plugins_points_data.discount_type == 1}}">你有积分{{plugins_points_data.user_integral}}个</text>
|
||||
<text a:else>你有积分{{plugins_points_data.user_integral}}个,可用{{plugins_points_data.use_integral}}个</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<view a:if="{{payment_list.length > 0 && common_order_is_booking != 1}}" class="payment-list bg-white oh">
|
||||
<view class="item tc fl" a:for="{{payment_list}}">
|
||||
|
||||
@ -33,21 +33,16 @@ Page({
|
||||
plugins_choice_coupon_value: [],
|
||||
popup_plugins_coupon_status: false,
|
||||
popup_plugins_coupon_index: null,
|
||||
|
||||
// 积分
|
||||
plugins_points_data: null,
|
||||
plugins_points_status: false,
|
||||
},
|
||||
onLoad(params) {
|
||||
//params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}';
|
||||
if((params.data || null) == null || app.get_length(JSON.parse(params.data)) == 0)
|
||||
if((params.data || null) != null && app.get_length(JSON.parse(decodeURIComponent(params.data))) > 0)
|
||||
{
|
||||
my.alert({
|
||||
title: '温馨提示',
|
||||
content: '订单信息有误',
|
||||
buttonText: '确认',
|
||||
success: () => {
|
||||
my.navigateBack();
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.setData({ params: JSON.parse(params.data)});
|
||||
this.setData({ params: JSON.parse(decodeURIComponent(params.data))});
|
||||
|
||||
// 删除地址缓存
|
||||
my.removeStorageSync({key: app.data.cache_buy_user_address_select_key});
|
||||
@ -117,7 +112,7 @@ Page({
|
||||
my.request({
|
||||
url: app.get_request_url("index", "buy"),
|
||||
method: "POST",
|
||||
data: this.request_data_coupon_merge(data),
|
||||
data: this.request_data_ext_params_merge(data),
|
||||
dataType: "json",
|
||||
headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: res => {
|
||||
@ -137,6 +132,7 @@ Page({
|
||||
common_site_type: data.common_site_type || 0,
|
||||
extraction_address: data.base.extraction_address || [],
|
||||
plugins_coupon_data: data.plugins_coupon_data || null,
|
||||
plugins_points_data: data.plugins_points_data || null,
|
||||
});
|
||||
|
||||
// 优惠劵选择处理
|
||||
@ -192,8 +188,9 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
// 请求参数合并优惠券参数
|
||||
request_data_coupon_merge(data) {
|
||||
// 请求参数合并
|
||||
request_data_ext_params_merge(data) {
|
||||
// 优惠券
|
||||
var coupon_ids = this.data.plugins_use_coupon_ids;
|
||||
if((coupon_ids || null) != null && coupon_ids.length > 0)
|
||||
{
|
||||
@ -202,6 +199,10 @@ Page({
|
||||
data['coupon_id_'+i] = coupon_ids[i];
|
||||
}
|
||||
}
|
||||
|
||||
// 积分
|
||||
data['is_points'] = (this.data.plugins_points_status === true) ? 1 : 0;
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
@ -251,7 +252,7 @@ Page({
|
||||
my.request({
|
||||
url: app.get_request_url("add", "buy"),
|
||||
method: "POST",
|
||||
data: this.request_data_coupon_merge(data),
|
||||
data: this.request_data_ext_params_merge(data),
|
||||
dataType: "json",
|
||||
headers: { 'content-type': 'application/x-www-form-urlencoded' },
|
||||
success: res => {
|
||||
@ -396,4 +397,10 @@ Page({
|
||||
var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
|
||||
app.open_location(data.lng, data.lat, name, address);
|
||||
},
|
||||
|
||||
// 积分选择事件
|
||||
points_event(e) {
|
||||
this.setData({plugins_points_status: !this.data.plugins_points_status});
|
||||
this.init();
|
||||
},
|
||||
});
|
||||
|
||||
@ -439,7 +439,7 @@ Page({
|
||||
"ids": ids.join(',')
|
||||
};
|
||||
my.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
url: '/pages/buy/buy?data=' + encodeURIComponent(JSON.stringify(data))
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@ -369,4 +369,45 @@
|
||||
}
|
||||
.goods-parameters .content-item .item:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品简述
|
||||
*/
|
||||
.goods-simple-desc {
|
||||
color: #f00;
|
||||
padding: 0 10rpx;
|
||||
margin: 5rpx 0 15rpx 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* icon
|
||||
*/
|
||||
.goods-icon-container {
|
||||
padding: 20rpx 10rpx 10rpx 10rpx;
|
||||
}
|
||||
.goods-icon-container view {
|
||||
background: #fff;
|
||||
border: 1px solid #3bb4f2;
|
||||
color: #3bb4f2;
|
||||
padding: 3rpx 15rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.goods-icon-container view:not(:last-child) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 面板
|
||||
*/
|
||||
.goods-panel-container {
|
||||
background: #fffbfc;
|
||||
color: #d2354c;
|
||||
}
|
||||
.goods-panel-container view {
|
||||
padding: 15rpx 10rpx;
|
||||
}
|
||||
.goods-panel-container view:not(:first-child) {
|
||||
border-top: 1px dashed #fff1f2;
|
||||
}
|
||||
@ -29,6 +29,23 @@
|
||||
<!-- 标题 -->
|
||||
<view class="goods-title multi-text" style="color:{{goods.title_color}}">{{goods.title}}</view>
|
||||
|
||||
<!-- 简述 -->
|
||||
<view a:if="{{(goods.simple_desc || null) != null}}" class="goods-simple-desc">{{goods.simple_desc}}</view>
|
||||
|
||||
<!-- icon -->
|
||||
<view a:if="{{(goods.plugins_view_icon_data || null) != null && goods.plugins_view_icon_data.length > 0}}" class="goods-icon-container bg-white br-b-dashed oh">
|
||||
<block a:for="{{goods.plugins_view_icon_data}}" a:key="key">
|
||||
<view a:if="{{(item.name || null) != null}}" class="fl tc" style="{{(item.br_color || null) == null ? '' : 'border:1px solid '+item.br_color+';'}}{{(item.color || null) == null ? '' : 'color: '+item.color+';'}}">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 面板提示信息 -->
|
||||
<view a:if="{{(goods.plugins_view_panel_data || null) != null && goods.plugins_view_panel_data.length > 0}}" class="goods-panel-container bg-white br-b-dashed oh">
|
||||
<block a:for="{{goods.plugins_view_panel_data}}" a:key="key">
|
||||
<view a:if="{{(item || null) != null}}">{{item}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 限时秒杀 -->
|
||||
<view a:if="{{plugins_limitedtimediscount_is_valid == 1}}">
|
||||
<import src="/pages/lib/limitedtimediscount/goods-detail.axml" />
|
||||
|
||||
@ -629,7 +629,7 @@ Page({
|
||||
"spec": JSON.stringify(spec)
|
||||
};
|
||||
my.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
url: '/pages/buy/buy?data=' + encodeURIComponent(JSON.stringify(data))
|
||||
});
|
||||
this.popup_close_event();
|
||||
break;
|
||||
|
||||
@ -7,10 +7,6 @@
|
||||
</view>
|
||||
<view class="data-detail">{{item.detail}}</view>
|
||||
</view>
|
||||
<view a:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.axml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.axml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
|
||||
107
sourcecode/alipay/default/pages/plugins/points/index/index.acss
Normal file
107
sourcecode/alipay/default/pages/plugins/points/index/index.acss
Normal file
@ -0,0 +1,107 @@
|
||||
/**
|
||||
* 顶部
|
||||
*/
|
||||
.points-user {
|
||||
background-color: #fe3e28;
|
||||
position: relative;
|
||||
padding: 100rpx 0 120rpx 0;
|
||||
}
|
||||
.points-user .avatar {
|
||||
padding: 1px;
|
||||
background: #ff9589;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.points-user .avatar,
|
||||
.points-user .avatar image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.points-user .user-name {
|
||||
color: #fff;
|
||||
margin: 10rpx 0 20rpx 0;
|
||||
}
|
||||
.points-user .user-desc {
|
||||
color: #ffe7b2;
|
||||
}
|
||||
.points-user-menu-submit {
|
||||
border: 1px solid #ffd606;
|
||||
color: #fae501;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
.submit-container {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.submit-container button:not(:first-child) {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
button.login-submit {
|
||||
color: #5eb95e;
|
||||
background-color: #E4F3E4;
|
||||
border-color: #d2e8d2;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.submit-container button.share-submit {
|
||||
color: #F37B1D;
|
||||
background-color: #ffe5be;
|
||||
border-color: #f8d093;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品导航
|
||||
*/
|
||||
.spacing-nav-title {
|
||||
color: #fe3e28;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
background: #fe3e28;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 80rpx);
|
||||
}
|
||||
.data-list {
|
||||
overflow: hidden;
|
||||
}
|
||||
.data-list .items {
|
||||
width: calc(50% - 5rpx);
|
||||
margin-bottom: 10rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.data-list .items:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
.data-list .items:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
.data-list .items image {
|
||||
width: 100%;
|
||||
height: 200px !important;
|
||||
}
|
||||
.data-list .items .base {
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
padding: 0 15rpx;
|
||||
}
|
||||
.data-list .items .base,
|
||||
.data-list .items .base .price {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.data-list .items .base .original-price {
|
||||
margin-left: 0;
|
||||
}
|
||||
.data-list .items .base .price .sales-price {
|
||||
margin: 0 5rpx;
|
||||
}
|
||||
.data-list .items .base .price .unit {
|
||||
color: #f40;
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
<view a:if="{{(data_base || null) != null}}">
|
||||
<!-- 顶部 -->
|
||||
<view class="points-user tc">
|
||||
<navigator class="points-user-menu-submit" url="/pages/user-integral/user-integral" hover-class="none">我的积分</navigator>
|
||||
<block a:if="{{(user || null) == null}}">
|
||||
<button type="default" size="mini" class="login-submit" onTap="login_event">立即登录</button>
|
||||
<view class="user-desc">获知会员积分详情</view>
|
||||
</block>
|
||||
<block a:else>
|
||||
<view class="avatar">
|
||||
<image onTap="preview_event" src="{{user.avatar || avatar_default}}" mode="widthFix" class="dis-block" />
|
||||
</view>
|
||||
<view class="user-name">{{user.user_name_view}}</view>
|
||||
<view class="user-desc">当前可用 {{user.integral}} 积分</view>
|
||||
</block>
|
||||
|
||||
<!-- 按钮组 -->
|
||||
<view class="submit-container">
|
||||
<button type="default" size="mini" open-type="share" class="share-submit">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 广告图片 -->
|
||||
<image a:if="{{(data_base.right_images || null) != null}}" src="{{data_base.right_images}}" class="wh-auto dis-block spacing-mt" mode="widthFix" onTap="right_images_event" />
|
||||
|
||||
<!-- 公告信息 -->
|
||||
<view a:if="{{(data_base.points_desc || null) != null && data_base.points_desc.length > 0}}" class="tips spacing-mt">
|
||||
<view a:for="{{data_base.points_desc}}" a:key="key" class="item">
|
||||
{{item}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品兑换 -->
|
||||
<view a:if="{{(data_base.goods_exchange_data || null) != null && data_base.goods_exchange_data.length > 0}}" class="spacing-mt">
|
||||
<view class="spacing-nav-title">
|
||||
<text class="line"></text>
|
||||
<text class="text-wrapper">商品兑换</text>
|
||||
</view>
|
||||
<view class="data-list spacing-10">
|
||||
<view class="items bg-white" a:for="{{data_base.goods_exchange_data}}" a:key="key">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods.id}}" hover-class="none">
|
||||
<image src="{{item.goods.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.goods.title}}</view>
|
||||
<view class="price single-text original-price">{{currency_symbol}}{{item.goods.price}}</view>
|
||||
<view class="price single-text">
|
||||
<text class="unit">需</text>
|
||||
<text class="sales-price">{{item.integral}}</text>
|
||||
<text class="unit">积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.axml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</view>
|
||||
<view a:else>
|
||||
<import src="/pages/common/nodata.axml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
122
sourcecode/alipay/default/pages/plugins/points/index/index.js
Normal file
122
sourcecode/alipay/default/pages/plugins/points/index/index.js
Normal file
@ -0,0 +1,122 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
avatar_default: app.data.default_user_head_src,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
user: app.get_user_cache_info(),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
app.set_nav_bg_color_main('#fe3e28');
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
var self = this;
|
||||
my.request({
|
||||
url: app.get_request_url("index", "index", "points"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
my.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
data_base: data.base || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
my.stopPullDownRefresh();
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 立即登录
|
||||
login_event() {
|
||||
var user = app.get_user_info(this, "login_event")
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.user_is_need_login(user)) {
|
||||
my.confirm({
|
||||
title: '温馨提示',
|
||||
content: '绑定手机号码',
|
||||
confirmButtonText: '确认',
|
||||
cancelButtonText: '暂不',
|
||||
success: (result) => {
|
||||
my.stopPullDownRefresh();
|
||||
if (result.confirm) {
|
||||
my.navigateTo({
|
||||
url: "/pages/login/login?event_callback=init"
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
this.setData({user: user || null});
|
||||
},
|
||||
|
||||
// 图片事件
|
||||
right_images_event(e) {
|
||||
if((this.data.data_base.right_images_url || null) != null)
|
||||
{
|
||||
my.navigateTo({
|
||||
url: this.data.data_base.right_images_url,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.data.default_user_head_src != this.data.user.avatar) {
|
||||
my.previewImage({
|
||||
current: 0,
|
||||
urls: [this.data.user.avatar]
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data.data_base.seo_title || '积分商城 - '+app.data.application_title,
|
||||
desc: this.data.data_base.seo_desc || '积分抵扣、兑换 - '+app.data.application_describe,
|
||||
path: '/pages/plugins/signin/index-detail/index-detail?referrer=' + user_id
|
||||
};
|
||||
},
|
||||
});
|
||||
@ -0,0 +1,5 @@
|
||||
{
|
||||
"pullRefresh": true,
|
||||
"titleBarColor": "#fe3e28",
|
||||
"defaultTitle": "积分商城"
|
||||
}
|
||||
@ -97,6 +97,16 @@
|
||||
border-radius: 1000rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品导航
|
||||
*/
|
||||
.spacing-nav-title {
|
||||
color: #f6b015;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
background: #f6b015;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
|
||||
@ -55,8 +55,8 @@
|
||||
<image src="{{item.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view class="price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.min_price}}</text>
|
||||
<view class="price single-text">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
@ -75,7 +75,7 @@
|
||||
<text class="coming-tips-text">获得 <text>{{coming_integral}}</text> 积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.axml" />
|
||||
|
||||
@ -24,6 +24,7 @@ Page({
|
||||
},
|
||||
|
||||
onShow() {
|
||||
app.set_nav_bg_color_main('#f6b015');
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
{
|
||||
"pullRefresh": true,
|
||||
"navigationBarBackgroundColor": "#f6b015",
|
||||
"titleBarColor": "#f6b015",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"defaultTitle": "签到"
|
||||
}
|
||||
@ -16,7 +16,9 @@ Page({
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() { },
|
||||
onShow() {
|
||||
app.set_nav_bg_color_main('#f6b015');
|
||||
},
|
||||
|
||||
init() {
|
||||
var user = app.get_user_info(this, 'init');
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
{
|
||||
"pullRefresh": true,
|
||||
"navigationBarBackgroundColor": "#f6b015",
|
||||
"titleBarColor": "#f6b015",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"defaultTitle": "用户签到"
|
||||
}
|
||||
@ -16,7 +16,9 @@ Page({
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {},
|
||||
onShow() {
|
||||
app.set_nav_bg_color_main('#f6b015');
|
||||
},
|
||||
|
||||
init() {
|
||||
var self = this;
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
{
|
||||
"pullRefresh": true,
|
||||
"navigationBarBackgroundColor": "#f6b015",
|
||||
"titleBarColor": "#f6b015",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"defaultTitle": "签到码详情"
|
||||
}
|
||||
@ -14,7 +14,9 @@ Page({
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() {},
|
||||
onShow() {
|
||||
app.set_nav_bg_color_main('#f6b015');
|
||||
},
|
||||
|
||||
init() {
|
||||
var self = this;
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
{
|
||||
"pullRefresh": true,
|
||||
"navigationBarBackgroundColor": "#f6b015",
|
||||
"titleBarColor": "#f6b015",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"defaultTitle": "签到码新增/编辑"
|
||||
}
|
||||
@ -17,6 +17,7 @@ Page({
|
||||
},
|
||||
|
||||
onShow() {
|
||||
app.set_nav_bg_color_main('#f6b015');
|
||||
this.init();
|
||||
},
|
||||
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
{
|
||||
"pullRefresh": true,
|
||||
"navigationBarBackgroundColor": "#f6b015",
|
||||
"titleBarColor": "#f6b015",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"defaultTitle": "签到码管理"
|
||||
}
|
||||
@ -16,7 +16,9 @@ Page({
|
||||
this.init();
|
||||
},
|
||||
|
||||
onShow() { },
|
||||
onShow() {
|
||||
app.set_nav_bg_color_main('#f6b015');
|
||||
},
|
||||
|
||||
init() {
|
||||
var user = app.get_user_info(this, 'init');
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
{
|
||||
"pullRefresh": true,
|
||||
"navigationBarBackgroundColor": "#f6b015",
|
||||
"titleBarColor": "#f6b015",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"defaultTitle": "我的签到"
|
||||
}
|
||||
@ -11,6 +11,7 @@ Page({
|
||||
onLoad(params) {},
|
||||
|
||||
onShow() {
|
||||
app.set_nav_bg_color_main('#f6b015');
|
||||
this.init();
|
||||
},
|
||||
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
{
|
||||
"pullRefresh": true,
|
||||
"navigationBarBackgroundColor": "#f6b015",
|
||||
"titleBarColor": "#f6b015",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"defaultTitle": "签到"
|
||||
}
|
||||
@ -2,7 +2,6 @@
|
||||
<view class="content">
|
||||
<view class="data-card bg-white br-b" a:for="{{data_list}}">
|
||||
<view class="data-box oh">
|
||||
<import src="/pages/common/nodata.axml" />
|
||||
<text class="data-title">{{item.type_text}} {{item.operation_integral}}</text>
|
||||
<text class="data-time fr">{{item.add_time_time}}</text>
|
||||
</view>
|
||||
@ -12,10 +11,6 @@
|
||||
</view>
|
||||
<view class="data-detail">{{item.msg}}</view>
|
||||
</view>
|
||||
<view a:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.axml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.axml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
|
||||
@ -53,7 +53,8 @@
|
||||
"pages/plugins/signin/user-qrcode/user-qrcode",
|
||||
"pages/plugins/signin/user-qrcode-detail/user-qrcode-detail",
|
||||
"pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo",
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list"
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list",
|
||||
"pages/plugins/points/index/index"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTitleText": "{{application_title}}",
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
}
|
||||
.data-list .items .title {
|
||||
margin-top: 10rpx;
|
||||
font-size: 32rpx;
|
||||
font-size: 30rpx;
|
||||
text-align:center;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@ -180,10 +180,10 @@
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 插件样式区域
|
||||
*/
|
||||
/**
|
||||
/*
|
||||
* 优惠劵
|
||||
*/
|
||||
.plugins-coupon {
|
||||
@ -209,4 +209,24 @@
|
||||
.coupon-container .not-use-tips {
|
||||
color: #f7b240;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 积分
|
||||
*/
|
||||
.plugins-points-buy-container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.plugins-points-buy-container .select .icon {
|
||||
width: 45rpx;
|
||||
height: 45rpx !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.plugins-points-buy-container .select .sales-price {
|
||||
margin-left: 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
.plugins-points-buy-container .desc {
|
||||
color: #F37B1D;
|
||||
}
|
||||
@ -32,12 +32,17 @@ Page({
|
||||
plugins_use_coupon_ids: [],
|
||||
plugins_choice_coupon_value: [],
|
||||
popup_plugins_coupon_status: false,
|
||||
popup_plugins_coupon_index: null
|
||||
popup_plugins_coupon_index: null,
|
||||
|
||||
// 积分
|
||||
plugins_points_data: null,
|
||||
plugins_points_status: false,
|
||||
},
|
||||
onLoad(params) {
|
||||
//params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}';
|
||||
if ((params.data || null) != null && app.get_length(JSON.parse(params.data)) > 0) {
|
||||
this.setData({ params: JSON.parse(params.data) });
|
||||
if((params.data || null) != null && app.get_length(JSON.parse(decodeURIComponent(params.data))) > 0)
|
||||
{
|
||||
this.setData({ params: JSON.parse(decodeURIComponent(params.data))});
|
||||
|
||||
// 删除地址缓存
|
||||
swan.removeStorageSync(app.data.cache_buy_user_address_select_key);
|
||||
@ -101,7 +106,7 @@ Page({
|
||||
swan.request({
|
||||
url: app.get_request_url("index", "buy"),
|
||||
method: "POST",
|
||||
data: this.request_data_coupon_merge(data),
|
||||
data: this.request_data_ext_params_merge(data),
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
swan.stopPullDownRefresh();
|
||||
@ -118,7 +123,8 @@ Page({
|
||||
data_list_loding_status: 3,
|
||||
common_site_type: data.common_site_type || 0,
|
||||
extraction_address: data.base.extraction_address || [],
|
||||
plugins_coupon_data: data.plugins_coupon_data || null
|
||||
plugins_coupon_data: data.plugins_coupon_data || null,
|
||||
plugins_points_data: data.plugins_points_data || null,
|
||||
});
|
||||
|
||||
// 优惠劵选择处理
|
||||
@ -172,14 +178,19 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
// 请求参数合并优惠券参数
|
||||
request_data_coupon_merge(data) {
|
||||
// 请求参数合并
|
||||
request_data_ext_params_merge(data) {
|
||||
// 优惠券
|
||||
var coupon_ids = this.data.plugins_use_coupon_ids;
|
||||
if ((coupon_ids || null) != null && coupon_ids.length > 0) {
|
||||
for (var i in coupon_ids) {
|
||||
data['coupon_id_' + i] = coupon_ids[i];
|
||||
}
|
||||
}
|
||||
|
||||
// 积分
|
||||
data['is_points'] = (this.data.plugins_points_status === true) ? 1 : 0;
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
@ -229,7 +240,7 @@ Page({
|
||||
swan.request({
|
||||
url: app.get_request_url("add", "buy"),
|
||||
method: "POST",
|
||||
data: this.request_data_coupon_merge(data),
|
||||
data: this.request_data_ext_params_merge(data),
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
swan.hideLoading();
|
||||
@ -365,5 +376,11 @@ Page({
|
||||
var name = data.alias || data.name || '';
|
||||
var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
|
||||
app.open_location(data.lng, data.lat, name, address);
|
||||
}
|
||||
},
|
||||
|
||||
// 积分选择事件
|
||||
points_event(e) {
|
||||
this.setData({plugins_points_status: !this.data.plugins_points_status});
|
||||
this.init();
|
||||
},
|
||||
});
|
||||
@ -90,6 +90,22 @@
|
||||
<view s-else bindtap="bind_user_note_tap_event" class="{{(user_note_value || null) == null ? 'cr-888' : ''}}">{{user_note_value || '留言'}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 积分 -->
|
||||
<view s-if="(plugins_points_data || null) != null && (plugins_points_data.discount_price || 0) > 0" class="plugins-points-buy-container bg-white spacing-mb">
|
||||
<view class="select oh">
|
||||
<text s-if="plugins_points_data.discount_type == 1">使用{{plugins_points_data.use_integral}}个积分兑换商品</text>
|
||||
<text s-else>使用积分{{plugins_points_data.use_integral}}个</text>
|
||||
<text class="sales-price">-{{currency_symbol}}{{plugins_points_data.discount_price}}</text>
|
||||
<view bindtap="points_event" class="fr">
|
||||
<image class="icon" src="/images/default-select{{plugins_points_status ? '-active' : ''}}-icon.png" mode="widthFix" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<text s-if="plugins_points_data.discount_type == 1">你有积分{{plugins_points_data.user_integral}}个</text>
|
||||
<text s-else>你有积分{{plugins_points_data.user_integral}}个,可用{{plugins_points_data.use_integral}}个</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<view s-if="payment_list.length > 0 && common_order_is_booking != 1" class="payment-list bg-white oh">
|
||||
<view class="item tc fl" s-for="item, index in payment_list" s-key="key">
|
||||
|
||||
@ -391,7 +391,7 @@ Page({
|
||||
"ids": ids.join(',')
|
||||
};
|
||||
swan.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
url: '/pages/buy/buy?data=' + encodeURIComponent(JSON.stringify(data))
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@ -368,4 +368,45 @@
|
||||
}
|
||||
.goods-parameters .content-item .item:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品简述
|
||||
*/
|
||||
.goods-simple-desc {
|
||||
color: #f00;
|
||||
padding: 0 10rpx;
|
||||
margin: 5rpx 0 15rpx 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* icon
|
||||
*/
|
||||
.goods-icon-container {
|
||||
padding: 20rpx 10rpx 10rpx 10rpx;
|
||||
}
|
||||
.goods-icon-container view {
|
||||
background: #fff;
|
||||
border: 1px solid #3bb4f2;
|
||||
color: #3bb4f2;
|
||||
padding: 3rpx 15rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.goods-icon-container view:not(:last-child) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 面板
|
||||
*/
|
||||
.goods-panel-container {
|
||||
background: #fffbfc;
|
||||
color: #d2354c;
|
||||
}
|
||||
.goods-panel-container view {
|
||||
padding: 15rpx 10rpx;
|
||||
}
|
||||
.goods-panel-container view:not(:first-child) {
|
||||
border-top: 1px dashed #fff1f2;
|
||||
}
|
||||
@ -563,7 +563,7 @@ Page({
|
||||
"spec": JSON.stringify(spec)
|
||||
};
|
||||
swan.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
url: '/pages/buy/buy?data=' + encodeURIComponent(JSON.stringify(data))
|
||||
});
|
||||
this.popup_close_event();
|
||||
break;
|
||||
|
||||
@ -23,6 +23,23 @@
|
||||
<!-- 标题 -->
|
||||
<view class="goods-title multi-text" style="color:{{goods.title_color}}">{{goods.title}}</view>
|
||||
|
||||
<!-- 简述 -->
|
||||
<view s-if="(goods.simple_desc || null) != null" class="goods-simple-desc">{{goods.simple_desc}}</view>
|
||||
|
||||
<!-- icon -->
|
||||
<view s-if="(goods.plugins_view_icon_data || null) != null && goods.plugins_view_icon_data.length > 0" class="goods-icon-container bg-white br-b-dashed oh">
|
||||
<block s-for="item, index in goods.plugins_view_icon_data" s-key="key">
|
||||
<view s-if="(item.name || null) != null" class="fl tc" style="{{(item.br_color || null) == null ? '' : 'border:1px solid '+item.br_color+';'}}{{(item.color || null) == null ? '' : 'color: '+item.color+';'}}">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 面板提示信息 -->
|
||||
<view s-if="(goods.plugins_view_panel_data || null) != null && goods.plugins_view_panel_data.length > 0" class="goods-panel-container bg-white br-b-dashed oh">
|
||||
<block s-for="item, index in goods.plugins_view_panel_data" s-key="key">
|
||||
<view s-if="(item || null) != null">{{item}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 限时秒杀 -->
|
||||
<view s-if="plugins_limitedtimediscount_is_valid == 1">
|
||||
<import src="/pages/lib/limitedtimediscount/goods-detail.swan" />
|
||||
|
||||
@ -7,10 +7,6 @@
|
||||
</view>
|
||||
<view class="data-detail">{{item.detail}}</view>
|
||||
</view>
|
||||
<view s-if="data_list.length == 0">
|
||||
<import src="/pages/common/nodata.swan" />
|
||||
<template is="nodata" data="{{{status: data_list_loding_status}}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.swan" />
|
||||
<template is="bottom_line" data="{{{status: data_bottom_line_status}}}"></template>
|
||||
|
||||
107
sourcecode/baidu/default/pages/plugins/points/index/index.css
Normal file
107
sourcecode/baidu/default/pages/plugins/points/index/index.css
Normal file
@ -0,0 +1,107 @@
|
||||
/**
|
||||
* 顶部
|
||||
*/
|
||||
.points-user {
|
||||
background-color: #fe3e28;
|
||||
position: relative;
|
||||
padding: 100rpx 0 120rpx 0;
|
||||
}
|
||||
.points-user .avatar {
|
||||
padding: 1px;
|
||||
background: #ff9589;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.points-user .avatar,
|
||||
.points-user .avatar image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.points-user .user-name {
|
||||
color: #fff;
|
||||
margin: 10rpx 0 20rpx 0;
|
||||
}
|
||||
.points-user .user-desc {
|
||||
color: #ffe7b2;
|
||||
}
|
||||
.points-user-menu-submit {
|
||||
border: 1px solid #ffd606;
|
||||
color: #fae501;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
.submit-container {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.submit-container button:not(:first-child) {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
button.login-submit {
|
||||
color: #5eb95e;
|
||||
background-color: #E4F3E4;
|
||||
border-color: #d2e8d2;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.submit-container button.share-submit {
|
||||
color: #F37B1D;
|
||||
background-color: #ffe5be;
|
||||
border-color: #f8d093;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品导航
|
||||
*/
|
||||
.spacing-nav-title {
|
||||
color: #fe3e28;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
background: #fe3e28;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 80rpx);
|
||||
}
|
||||
.data-list {
|
||||
overflow: hidden;
|
||||
}
|
||||
.data-list .items {
|
||||
width: calc(50% - 5rpx);
|
||||
margin-bottom: 10rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.data-list .items:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
.data-list .items:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
.data-list .items image {
|
||||
width: 100%;
|
||||
height: 200px !important;
|
||||
}
|
||||
.data-list .items .base {
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
padding: 0 15rpx;
|
||||
}
|
||||
.data-list .items .base,
|
||||
.data-list .items .base .price {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.data-list .items .base .original-price {
|
||||
margin-left: 0;
|
||||
}
|
||||
.data-list .items .base .price .sales-price {
|
||||
margin: 0 5rpx;
|
||||
}
|
||||
.data-list .items .base .price .unit {
|
||||
color: #f40;
|
||||
}
|
||||
128
sourcecode/baidu/default/pages/plugins/points/index/index.js
Normal file
128
sourcecode/baidu/default/pages/plugins/points/index/index.js
Normal file
@ -0,0 +1,128 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
avatar_default: app.data.default_user_head_src
|
||||
},
|
||||
|
||||
onReady() {},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
user: app.get_user_cache_info()
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
var self = this;
|
||||
swan.request({
|
||||
url: app.get_request_url("index", "index", "points"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
swan.stopPullDownRefresh();
|
||||
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
data_base: data.base || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
swan.stopPullDownRefresh();
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错'
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 立即登录
|
||||
login_event() {
|
||||
var user = app.get_user_info(this, "login_event");
|
||||
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.user_is_need_login(user)) {
|
||||
swan.showModal({
|
||||
title: '温馨提示',
|
||||
content: '绑定手机号码',
|
||||
confirmText: '确认',
|
||||
cancelText: '暂不',
|
||||
success: result => {
|
||||
swan.stopPullDownRefresh();
|
||||
|
||||
if (result.confirm) {
|
||||
swan.navigateTo({
|
||||
url: "/pages/login/login?event_callback=init"
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
user: user || null
|
||||
});
|
||||
},
|
||||
|
||||
// 图片事件
|
||||
right_images_event(e) {
|
||||
if ((this.data.data_base.right_images_url || null) != null) {
|
||||
swan.navigateTo({
|
||||
url: this.data.data_base.right_images_url
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.data.default_user_head_src != this.data.user.avatar) {
|
||||
swan.previewImage({
|
||||
current: this.data.user.avatar,
|
||||
urls: [this.data.user.avatar]
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data.data_base.seo_title || '积分商城 - ' + app.data.application_title,
|
||||
desc: this.data.data_base.seo_desc || '积分抵扣、兑换 - ' + app.data.application_describe,
|
||||
path: '/pages/plugins/signin/index-detail/index-detail?referrer=' + user_id
|
||||
};
|
||||
},
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#fe3e28",
|
||||
"backgroundColorTop": "#fe3e28",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarTitleText": "积分商城"
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
<view s-if="(data_base || null) != null">
|
||||
<!-- 顶部 -->
|
||||
<view class="points-user tc">
|
||||
<navigator class="points-user-menu-submit" url="/pages/user-integral/user-integral" hover-class="none">我的积分</navigator>
|
||||
<block s-if="(user || null) == null">
|
||||
<button type="default" size="mini" class="login-submit" bindtap="login_event">立即登录</button>
|
||||
<view class="user-desc">获知会员积分详情</view>
|
||||
</block>
|
||||
<block s-else>
|
||||
<view class="avatar">
|
||||
<image bindtap="preview_event" src="{{user.avatar || avatar_default}}" mode="widthFix" class="dis-block" />
|
||||
</view>
|
||||
<view class="user-name">{{user.user_name_view}}</view>
|
||||
<view class="user-desc">当前可用 {{user.integral}} 积分</view>
|
||||
</block>
|
||||
|
||||
<!-- 按钮组 -->
|
||||
<view class="submit-container">
|
||||
<button type="default" size="mini" open-type="share" class="share-submit">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 广告图片 -->
|
||||
<image s-if="(data_base.right_images || null) != null" src="{{data_base.right_images}}" class="wh-auto dis-block spacing-mt" mode="widthFix" bindtap="right_images_event" />
|
||||
|
||||
<!-- 公告信息 -->
|
||||
<view s-if="(data_base.points_desc || null) != null && data_base.points_desc.length > 0" class="tips spacing-mt">
|
||||
<view s-for="item, index in data_base.points_desc" s-key="key" class="item">
|
||||
{{item}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品兑换 -->
|
||||
<view s-if="(data_base.goods_exchange_data || null) != null && data_base.goods_exchange_data.length > 0" class="spacing-mt">
|
||||
<view class="spacing-nav-title">
|
||||
<text class="line"></text>
|
||||
<text class="text-wrapper">商品兑换</text>
|
||||
</view>
|
||||
<view class="data-list spacing-10">
|
||||
<view class="items bg-white" s-for="item, index in data_base.goods_exchange_data" s-key="key">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods.id}}" hover-class="none">
|
||||
<image src="{{item.goods.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.goods.title}}</view>
|
||||
<view class="price single-text original-price">{{currency_symbol}}{{item.goods.price}}</view>
|
||||
<view class="price single-text">
|
||||
<text class="unit">需</text>
|
||||
<text class="sales-price">{{item.integral}}</text>
|
||||
<text class="unit">积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.swan" />
|
||||
<template is="bottom_line" data="{{{status: data_bottom_line_status}}}"></template>
|
||||
</view>
|
||||
<view s-else>
|
||||
<import src="/pages/common/nodata.swan" />
|
||||
<template is="nodata" data="{{{status: data_list_loding_status, msg: data_list_loding_msg}}}"></template>
|
||||
</view>
|
||||
@ -97,6 +97,16 @@
|
||||
border-radius: 1000rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品导航
|
||||
*/
|
||||
.spacing-nav-title {
|
||||
color: #f6b015;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
background: #f6b015;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
|
||||
@ -55,8 +55,8 @@
|
||||
<image src="{{item.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view class="price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.min_price}}</text>
|
||||
<view class="price single-text">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
@ -75,7 +75,7 @@
|
||||
<text class="coming-tips-text">获得 <text>{{coming_integral}}</text> 积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.swan" />
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
<view class="content">
|
||||
<view class="data-card bg-white br-b" s-for="item, index in data_list">
|
||||
<view class="data-box oh">
|
||||
<import src="/pages/common/nodata.swan" />
|
||||
<text class="data-title">{{item.type_text}} {{item.operation_integral}}</text>
|
||||
<text class="data-time fr">{{item.add_time_time}}</text>
|
||||
</view>
|
||||
@ -12,10 +11,6 @@
|
||||
</view>
|
||||
<view class="data-detail">{{item.msg}}</view>
|
||||
</view>
|
||||
<view s-if="data_list.length == 0">
|
||||
<import src="/pages/common/nodata.swan" />
|
||||
<template is="nodata" data="{{{status: data_list_loding_status}}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.swan" />
|
||||
<template is="bottom_line" data="{{{status: data_bottom_line_status}}}"></template>
|
||||
|
||||
@ -53,7 +53,8 @@
|
||||
"pages/plugins/signin/user-qrcode/user-qrcode",
|
||||
"pages/plugins/signin/user-qrcode-detail/user-qrcode-detail",
|
||||
"pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo",
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list"
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list",
|
||||
"pages/plugins/points/index/index"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTitleText": "{{application_title}}",
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
}
|
||||
.data-list .items .title {
|
||||
margin-top: 10rpx;
|
||||
font-size: 32rpx;
|
||||
font-size: 30rpx;
|
||||
text-align:center;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@ -33,12 +33,16 @@ Page({
|
||||
plugins_choice_coupon_value: [],
|
||||
popup_plugins_coupon_status: false,
|
||||
popup_plugins_coupon_index: null,
|
||||
|
||||
// 积分
|
||||
plugins_points_data: null,
|
||||
plugins_points_status: false,
|
||||
},
|
||||
onLoad(params) {
|
||||
//params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}';
|
||||
if((params.data || null) != null && app.get_length(JSON.parse(params.data)) > 0)
|
||||
if((params.data || null) != null && app.get_length(JSON.parse(decodeURIComponent(params.data))) > 0)
|
||||
{
|
||||
this.setData({ params: JSON.parse(params.data)});
|
||||
this.setData({ params: JSON.parse(decodeURIComponent(params.data))});
|
||||
|
||||
// 删除地址缓存
|
||||
qq.removeStorageSync(app.data.cache_buy_user_address_select_key);
|
||||
@ -106,7 +110,7 @@ Page({
|
||||
qq.request({
|
||||
url: app.get_request_url("index", "buy"),
|
||||
method: "POST",
|
||||
data: this.request_data_coupon_merge(data),
|
||||
data: this.request_data_ext_params_merge(data),
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
qq.stopPullDownRefresh();
|
||||
@ -125,6 +129,7 @@ Page({
|
||||
common_site_type: data.common_site_type || 0,
|
||||
extraction_address: data.base.extraction_address || [],
|
||||
plugins_coupon_data: data.plugins_coupon_data || null,
|
||||
plugins_points_data: data.plugins_points_data || null,
|
||||
});
|
||||
|
||||
// 优惠劵选择处理
|
||||
@ -181,8 +186,9 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
// 请求参数合并优惠券参数
|
||||
request_data_coupon_merge(data) {
|
||||
// 请求参数合并
|
||||
request_data_ext_params_merge(data) {
|
||||
// 优惠券
|
||||
var coupon_ids = this.data.plugins_use_coupon_ids;
|
||||
if((coupon_ids || null) != null && coupon_ids.length > 0)
|
||||
{
|
||||
@ -191,6 +197,10 @@ Page({
|
||||
data['coupon_id_'+i] = coupon_ids[i];
|
||||
}
|
||||
}
|
||||
|
||||
// 积分
|
||||
data['is_points'] = (this.data.plugins_points_status === true) ? 1 : 0;
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
@ -241,7 +251,7 @@ Page({
|
||||
qq.request({
|
||||
url: app.get_request_url("add", "buy"),
|
||||
method: "POST",
|
||||
data: this.request_data_coupon_merge(data),
|
||||
data: this.request_data_ext_params_merge(data),
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
qq.hideLoading();
|
||||
@ -383,4 +393,10 @@ Page({
|
||||
var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
|
||||
app.open_location(data.lng, data.lat, name, address);
|
||||
},
|
||||
|
||||
// 积分选择事件
|
||||
points_event(e) {
|
||||
this.setData({plugins_points_status: !this.data.plugins_points_status});
|
||||
this.init();
|
||||
},
|
||||
});
|
||||
|
||||
@ -90,6 +90,22 @@
|
||||
<view qq:else bindtap="bind_user_note_tap_event" class="{{(user_note_value || null) == null ? 'cr-888' : ''}}">{{user_note_value || '留言'}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 积分 -->
|
||||
<view qq:if="{{(plugins_points_data || null) != null && (plugins_points_data.discount_price || 0) > 0}}" class="plugins-points-buy-container bg-white spacing-mb">
|
||||
<view class="select oh">
|
||||
<text qq:if="{{plugins_points_data.discount_type == 1}}">使用{{plugins_points_data.use_integral}}个积分兑换商品</text>
|
||||
<text qq:else>使用积分{{plugins_points_data.use_integral}}个</text>
|
||||
<text class="sales-price">-{{currency_symbol}}{{plugins_points_data.discount_price}}</text>
|
||||
<view bindtap="points_event" class="fr">
|
||||
<image class="icon" src="/images/default-select{{plugins_points_status ? '-active' : ''}}-icon.png" mode="widthFix" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<text qq:if="{{plugins_points_data.discount_type == 1}}">你有积分{{plugins_points_data.user_integral}}个</text>
|
||||
<text qq:else>你有积分{{plugins_points_data.user_integral}}个,可用{{plugins_points_data.use_integral}}个</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">
|
||||
|
||||
@ -180,10 +180,10 @@
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 插件样式区域
|
||||
*/
|
||||
/**
|
||||
/*
|
||||
* 优惠劵
|
||||
*/
|
||||
.plugins-coupon {
|
||||
@ -209,4 +209,24 @@
|
||||
.coupon-container .not-use-tips {
|
||||
color: #f7b240;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 积分
|
||||
*/
|
||||
.plugins-points-buy-container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.plugins-points-buy-container .select .icon {
|
||||
width: 45rpx;
|
||||
height: 45rpx !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.plugins-points-buy-container .select .sales-price {
|
||||
margin-left: 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
.plugins-points-buy-container .desc {
|
||||
color: #F37B1D;
|
||||
}
|
||||
@ -393,7 +393,7 @@ Page({
|
||||
"ids": ids.join(',')
|
||||
};
|
||||
qq.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
url: '/pages/buy/buy?data=' + encodeURIComponent(JSON.stringify(data))
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@ -610,7 +610,7 @@ Page({
|
||||
"spec": JSON.stringify(spec)
|
||||
};
|
||||
qq.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
url: '/pages/buy/buy?data=' + encodeURIComponent(JSON.stringify(data))
|
||||
});
|
||||
this.popup_close_event();
|
||||
break;
|
||||
|
||||
@ -29,6 +29,23 @@
|
||||
<!-- 标题 -->
|
||||
<view class="goods-title multi-text" style="color:{{goods.title_color}}">{{goods.title}}</view>
|
||||
|
||||
<!-- 简述 -->
|
||||
<view qq:if="{{(goods.simple_desc || null) != null}}" class="goods-simple-desc">{{goods.simple_desc}}</view>
|
||||
|
||||
<!-- icon -->
|
||||
<view qq:if="{{(goods.plugins_view_icon_data || null) != null && goods.plugins_view_icon_data.length > 0}}" class="goods-icon-container bg-white br-b-dashed oh">
|
||||
<block qq:for="{{goods.plugins_view_icon_data}}" qq:key="key">
|
||||
<view qq:if="{{(item.name || null) != null}}" class="fl tc" style="{{(item.br_color || null) == null ? '' : 'border:1px solid '+item.br_color+';'}}{{(item.color || null) == null ? '' : 'color: '+item.color+';'}}">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 面板提示信息 -->
|
||||
<view qq:if="{{(goods.plugins_view_panel_data || null) != null && goods.plugins_view_panel_data.length > 0}}" class="goods-panel-container bg-white br-b-dashed oh">
|
||||
<block qq:for="{{goods.plugins_view_panel_data}}" qq:key="key">
|
||||
<view qq:if="{{(item || null) != null}}">{{item}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 限时秒杀 -->
|
||||
<view qq:if="{{plugins_limitedtimediscount_is_valid == 1}}">
|
||||
<import src="/pages/lib/limitedtimediscount/goods-detail.qml" />
|
||||
|
||||
@ -364,4 +364,45 @@
|
||||
}
|
||||
.goods-parameters .content-item .item:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品简述
|
||||
*/
|
||||
.goods-simple-desc {
|
||||
color: #f00;
|
||||
padding: 0 10rpx;
|
||||
margin: 5rpx 0 15rpx 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* icon
|
||||
*/
|
||||
.goods-icon-container {
|
||||
padding: 20rpx 10rpx 10rpx 10rpx;
|
||||
}
|
||||
.goods-icon-container view {
|
||||
background: #fff;
|
||||
border: 1px solid #3bb4f2;
|
||||
color: #3bb4f2;
|
||||
padding: 3rpx 15rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.goods-icon-container view:not(:last-child) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 面板
|
||||
*/
|
||||
.goods-panel-container {
|
||||
background: #fffbfc;
|
||||
color: #d2354c;
|
||||
}
|
||||
.goods-panel-container view {
|
||||
padding: 15rpx 10rpx;
|
||||
}
|
||||
.goods-panel-container view:not(:first-child) {
|
||||
border-top: 1px dashed #fff1f2;
|
||||
}
|
||||
@ -7,10 +7,6 @@
|
||||
</view>
|
||||
<view class="data-detail">{{item.detail}}</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>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.qml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
|
||||
121
sourcecode/qq/default/pages/plugins/points/index/index.js
Normal file
121
sourcecode/qq/default/pages/plugins/points/index/index.js
Normal file
@ -0,0 +1,121 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
avatar_default: app.data.default_user_head_src,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
user: app.get_user_cache_info(),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
var self = this;
|
||||
qq.request({
|
||||
url: app.get_request_url("index", "index", "points"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
qq.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
data_base: data.base || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
qq.stopPullDownRefresh();
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 立即登录
|
||||
login_event() {
|
||||
var user = app.get_user_info(this, "login_event")
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.user_is_need_login(user)) {
|
||||
qq.showModal({
|
||||
title: '温馨提示',
|
||||
content: '绑定手机号码',
|
||||
confirmText: '确认',
|
||||
cancelText: '暂不',
|
||||
success: (result) => {
|
||||
qq.stopPullDownRefresh();
|
||||
if (result.confirm) {
|
||||
qq.navigateTo({
|
||||
url: "/pages/login/login?event_callback=init"
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
this.setData({user: user || null});
|
||||
},
|
||||
|
||||
// 图片事件
|
||||
right_images_event(e) {
|
||||
if((this.data.data_base.right_images_url || null) != null)
|
||||
{
|
||||
qq.navigateTo({
|
||||
url: this.data.data_base.right_images_url,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.data.default_user_head_src != this.data.user.avatar) {
|
||||
qq.previewImage({
|
||||
current: this.data.user.avatar,
|
||||
urls: [this.data.user.avatar]
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data.data_base.seo_title || '积分商城 - '+app.data.application_title,
|
||||
desc: this.data.data_base.seo_desc || '积分抵扣、兑换 - '+app.data.application_describe,
|
||||
path: '/pages/plugins/signin/index-detail/index-detail?referrer=' + user_id
|
||||
};
|
||||
},
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#fe3e28",
|
||||
"backgroundColorTop": "#fe3e28",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarTitleText": "积分商城"
|
||||
}
|
||||
64
sourcecode/qq/default/pages/plugins/points/index/index.qml
Normal file
64
sourcecode/qq/default/pages/plugins/points/index/index.qml
Normal file
@ -0,0 +1,64 @@
|
||||
<view qq:if="{{(data_base || null) != null}}">
|
||||
<!-- 顶部 -->
|
||||
<view class="points-user tc">
|
||||
<navigator class="points-user-menu-submit" url="/pages/user-integral/user-integral" hover-class="none">我的积分</navigator>
|
||||
<block qq:if="{{(user || null) == null}}">
|
||||
<button type="default" size="mini" class="login-submit" bindtap="login_event">立即登录</button>
|
||||
<view class="user-desc">获知会员积分详情</view>
|
||||
</block>
|
||||
<block qq:else>
|
||||
<view class="avatar">
|
||||
<image bindtap="preview_event" src="{{user.avatar || avatar_default}}" mode="widthFix" class="dis-block" />
|
||||
</view>
|
||||
<view class="user-name">{{user.user_name_view}}</view>
|
||||
<view class="user-desc">当前可用 {{user.integral}} 积分</view>
|
||||
</block>
|
||||
|
||||
<!-- 按钮组 -->
|
||||
<view class="submit-container">
|
||||
<button type="default" size="mini" open-type="share" class="share-submit">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 广告图片 -->
|
||||
<image qq:if="{{(data_base.right_images || null) != null}}" src="{{data_base.right_images}}" class="wh-auto dis-block spacing-mt" mode="widthFix" bindtap="right_images_event" />
|
||||
|
||||
<!-- 公告信息 -->
|
||||
<view qq:if="{{(data_base.points_desc || null) != null && data_base.points_desc.length > 0}}" class="tips spacing-mt">
|
||||
<view qq:for="{{data_base.points_desc}}" qq:key="key" class="item">
|
||||
{{item}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品兑换 -->
|
||||
<view qq:if="{{(data_base.goods_exchange_data || null) != null && data_base.goods_exchange_data.length > 0}}" class="spacing-mt">
|
||||
<view class="spacing-nav-title">
|
||||
<text class="line"></text>
|
||||
<text class="text-wrapper">商品兑换</text>
|
||||
</view>
|
||||
<view class="data-list spacing-10">
|
||||
<view class="items bg-white" qq:for="{{data_base.goods_exchange_data}}" qq:key="key">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods.id}}" hover-class="none">
|
||||
<image src="{{item.goods.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.goods.title}}</view>
|
||||
<view class="price single-text original-price">{{currency_symbol}}{{item.goods.price}}</view>
|
||||
<view class="price single-text">
|
||||
<text class="unit">需</text>
|
||||
<text class="sales-price">{{item.integral}}</text>
|
||||
<text class="unit">积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.qml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</view>
|
||||
<view qq:else>
|
||||
<import src="/pages/common/nodata.qml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
107
sourcecode/qq/default/pages/plugins/points/index/index.qss
Normal file
107
sourcecode/qq/default/pages/plugins/points/index/index.qss
Normal file
@ -0,0 +1,107 @@
|
||||
/**
|
||||
* 顶部
|
||||
*/
|
||||
.points-user {
|
||||
background-color: #fe3e28;
|
||||
position: relative;
|
||||
padding: 100rpx 0 120rpx 0;
|
||||
}
|
||||
.points-user .avatar {
|
||||
padding: 1px;
|
||||
background: #ff9589;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.points-user .avatar,
|
||||
.points-user .avatar image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.points-user .user-name {
|
||||
color: #fff;
|
||||
margin: 10rpx 0 20rpx 0;
|
||||
}
|
||||
.points-user .user-desc {
|
||||
color: #ffe7b2;
|
||||
}
|
||||
.points-user-menu-submit {
|
||||
border: 1px solid #ffd606;
|
||||
color: #fae501;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
.submit-container {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.submit-container button:not(:first-child) {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
button.login-submit {
|
||||
color: #5eb95e;
|
||||
background-color: #E4F3E4;
|
||||
border-color: #d2e8d2;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.submit-container button.share-submit {
|
||||
color: #F37B1D;
|
||||
background-color: #ffe5be;
|
||||
border-color: #f8d093;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品导航
|
||||
*/
|
||||
.spacing-nav-title {
|
||||
color: #fe3e28;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
background: #fe3e28;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 80rpx);
|
||||
}
|
||||
.data-list {
|
||||
overflow: hidden;
|
||||
}
|
||||
.data-list .items {
|
||||
width: calc(50% - 5rpx);
|
||||
margin-bottom: 10rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.data-list .items:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
.data-list .items:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
.data-list .items image {
|
||||
width: 100%;
|
||||
height: 200px !important;
|
||||
}
|
||||
.data-list .items .base {
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
padding: 0 15rpx;
|
||||
}
|
||||
.data-list .items .base,
|
||||
.data-list .items .base .price {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.data-list .items .base .original-price {
|
||||
margin-left: 0;
|
||||
}
|
||||
.data-list .items .base .price .sales-price {
|
||||
margin: 0 5rpx;
|
||||
}
|
||||
.data-list .items .base .price .unit {
|
||||
color: #f40;
|
||||
}
|
||||
@ -55,8 +55,8 @@
|
||||
<image src="{{item.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view class="price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.min_price}}</text>
|
||||
<view class="price single-text">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
@ -75,7 +75,7 @@
|
||||
<text class="coming-tips-text">获得 <text>{{coming_integral}}</text> 积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.qml" />
|
||||
|
||||
@ -97,6 +97,16 @@
|
||||
border-radius: 1000rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品导航
|
||||
*/
|
||||
.spacing-nav-title {
|
||||
color: #f6b015;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
background: #f6b015;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
<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.qml" />
|
||||
<text class="data-title">{{item.type_text}} {{item.operation_integral}}</text>
|
||||
<text class="data-time fr">{{item.add_time_time}}</text>
|
||||
</view>
|
||||
@ -12,10 +11,6 @@
|
||||
</view>
|
||||
<view class="data-detail">{{item.msg}}</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>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.qml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
|
||||
@ -72,7 +72,8 @@
|
||||
"pages/plugins/signin/user-qrcode/user-qrcode",
|
||||
"pages/plugins/signin/user-qrcode-detail/user-qrcode-detail",
|
||||
"pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo",
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list"
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list",
|
||||
"pages/plugins/points/index/index"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTitleText": "{{application_title}}",
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
}
|
||||
.data-list .items .title {
|
||||
margin-top: 10rpx;
|
||||
font-size: 32rpx;
|
||||
font-size: 30rpx;
|
||||
text-align:center;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@ -33,13 +33,17 @@ Page({
|
||||
plugins_choice_coupon_value: [],
|
||||
popup_plugins_coupon_status: false,
|
||||
popup_plugins_coupon_index: null,
|
||||
|
||||
// 积分
|
||||
plugins_points_data: null,
|
||||
plugins_points_status: false,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
//params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}';
|
||||
if((params.data || null) != null && app.get_length(JSON.parse(params.data)) > 0)
|
||||
if((params.data || null) != null && app.get_length(JSON.parse(decodeURIComponent(params.data))) > 0)
|
||||
{
|
||||
this.setData({ params: JSON.parse(params.data)});
|
||||
this.setData({ params: JSON.parse(decodeURIComponent(params.data))});
|
||||
|
||||
// 删除地址缓存
|
||||
tt.removeStorageSync(app.data.cache_buy_user_address_select_key);
|
||||
@ -107,7 +111,7 @@ Page({
|
||||
tt.request({
|
||||
url: app.get_request_url("index", "buy"),
|
||||
method: "POST",
|
||||
data: this.request_data_coupon_merge(data),
|
||||
data: this.request_data_ext_params_merge(data),
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
tt.stopPullDownRefresh();
|
||||
@ -128,7 +132,8 @@ Page({
|
||||
data_list_loding_status: 3,
|
||||
common_site_type: data.common_site_type || 0,
|
||||
extraction_address: data.base.extraction_address || [],
|
||||
plugins_coupon_data: data.plugins_coupon_data || null
|
||||
plugins_coupon_data: data.plugins_coupon_data || null,
|
||||
plugins_points_data: data.plugins_points_data || null,
|
||||
});
|
||||
|
||||
// 优惠劵选择处理
|
||||
@ -186,8 +191,9 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
// 请求参数合并优惠券参数
|
||||
request_data_coupon_merge(data) {
|
||||
// 请求参数合并
|
||||
request_data_ext_params_merge(data) {
|
||||
// 优惠券
|
||||
var coupon_ids = this.data.plugins_use_coupon_ids;
|
||||
|
||||
if ((coupon_ids || null) != null && coupon_ids.length > 0) {
|
||||
@ -196,6 +202,9 @@ Page({
|
||||
}
|
||||
}
|
||||
|
||||
// 积分
|
||||
data['is_points'] = (this.data.plugins_points_status === true) ? 1 : 0;
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
@ -256,7 +265,7 @@ Page({
|
||||
tt.request({
|
||||
url: app.get_request_url("add", "buy"),
|
||||
method: "POST",
|
||||
data: this.request_data_coupon_merge(data),
|
||||
data: this.request_data_ext_params_merge(data),
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
tt.hideLoading();
|
||||
@ -413,6 +422,11 @@ Page({
|
||||
var name = data.alias || data.name || '';
|
||||
var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
|
||||
app.open_location(data.lng, data.lat, name, address);
|
||||
}
|
||||
},
|
||||
|
||||
// 积分选择事件
|
||||
points_event(e) {
|
||||
this.setData({plugins_points_status: !this.data.plugins_points_status});
|
||||
this.init();
|
||||
},
|
||||
});
|
||||
@ -90,6 +90,22 @@
|
||||
<view tt:else bindtap="bind_user_note_tap_event" class="{{(user_note_value || null) == null ? 'cr-888' : ''}}">{{user_note_value || '留言'}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 积分 -->
|
||||
<view tt:if="{{(plugins_points_data || null) != null && (plugins_points_data.discount_price || 0) > 0}}" class="plugins-points-buy-container bg-white spacing-mb">
|
||||
<view class="select oh">
|
||||
<text tt:if="{{plugins_points_data.discount_type == 1}}">使用{{plugins_points_data.use_integral}}个积分兑换商品</text>
|
||||
<text tt:else>使用积分{{plugins_points_data.use_integral}}个</text>
|
||||
<text class="sales-price">-{{currency_symbol}}{{plugins_points_data.discount_price}}</text>
|
||||
<view bindtap="points_event" class="fr">
|
||||
<image class="icon" src="/images/default-select{{plugins_points_status ? '-active' : ''}}-icon.png" mode="widthFix" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<text tt:if="{{plugins_points_data.discount_type == 1}}">你有积分{{plugins_points_data.user_integral}}个</text>
|
||||
<text tt:else>你有积分{{plugins_points_data.user_integral}}个,可用{{plugins_points_data.use_integral}}个</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<view tt:if="{{payment_list.length > 0 && common_order_is_booking != 1}}" class="payment-list bg-white oh">
|
||||
<view class="item tc fl" tt:for="{{payment_list}}" tt:key="key">
|
||||
|
||||
@ -180,10 +180,10 @@
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 插件样式区域
|
||||
*/
|
||||
/**
|
||||
/*
|
||||
* 优惠劵
|
||||
*/
|
||||
.plugins-coupon {
|
||||
@ -209,4 +209,24 @@
|
||||
.coupon-container .not-use-tips {
|
||||
color: #f7b240;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 积分
|
||||
*/
|
||||
.plugins-points-buy-container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.plugins-points-buy-container .select .icon {
|
||||
width: 45rpx;
|
||||
height: 45rpx !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.plugins-points-buy-container .select .sales-price {
|
||||
margin-left: 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
.plugins-points-buy-container .desc {
|
||||
color: #F37B1D;
|
||||
}
|
||||
@ -393,7 +393,7 @@ Page({
|
||||
"ids": ids.join(',')
|
||||
};
|
||||
tt.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
url: '/pages/buy/buy?data=' + encodeURIComponent(JSON.stringify(data))
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@ -610,7 +610,7 @@ Page({
|
||||
"spec": JSON.stringify(spec)
|
||||
};
|
||||
tt.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
url: '/pages/buy/buy?data=' + encodeURIComponent(JSON.stringify(data))
|
||||
});
|
||||
this.popup_close_event();
|
||||
break;
|
||||
|
||||
@ -29,6 +29,23 @@
|
||||
<!-- 标题 -->
|
||||
<view class="goods-title multi-text" style="color:{{goods.title_color}}">{{goods.title}}</view>
|
||||
|
||||
<!-- 简述 -->
|
||||
<view tt:if="{{(goods.simple_desc || null) != null}}" class="goods-simple-desc">{{goods.simple_desc}}</view>
|
||||
|
||||
<!-- icon -->
|
||||
<view tt:if="{{(goods.plugins_view_icon_data || null) != null && goods.plugins_view_icon_data.length > 0}}" class="goods-icon-container bg-white br-b-dashed oh">
|
||||
<block tt:for="{{goods.plugins_view_icon_data}}" tt:key="key">
|
||||
<view tt:if="{{(item.name || null) != null}}" class="fl tc" style="{{(item.br_color || null) == null ? '' : 'border:1px solid '+item.br_color+';'}}{{(item.color || null) == null ? '' : 'color: '+item.color+';'}}">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 面板提示信息 -->
|
||||
<view tt:if="{{(goods.plugins_view_panel_data || null) != null && goods.plugins_view_panel_data.length > 0}}" class="goods-panel-container bg-white br-b-dashed oh">
|
||||
<block tt:for="{{goods.plugins_view_panel_data}}" tt:key="key">
|
||||
<view tt:if="{{(item || null) != null}}">{{item}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 限时秒杀 -->
|
||||
<view tt:if="{{plugins_limitedtimediscount_is_valid == 1}}">
|
||||
<import src="/pages/lib/limitedtimediscount/goods-detail.ttml" />
|
||||
|
||||
@ -364,4 +364,45 @@
|
||||
}
|
||||
.goods-parameters .content-item .item:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品简述
|
||||
*/
|
||||
.goods-simple-desc {
|
||||
color: #f00;
|
||||
padding: 0 10rpx;
|
||||
margin: 5rpx 0 15rpx 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* icon
|
||||
*/
|
||||
.goods-icon-container {
|
||||
padding: 20rpx 10rpx 10rpx 10rpx;
|
||||
}
|
||||
.goods-icon-container view {
|
||||
background: #fff;
|
||||
border: 1px solid #3bb4f2;
|
||||
color: #3bb4f2;
|
||||
padding: 3rpx 15rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.goods-icon-container view:not(:last-child) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 面板
|
||||
*/
|
||||
.goods-panel-container {
|
||||
background: #fffbfc;
|
||||
color: #d2354c;
|
||||
}
|
||||
.goods-panel-container view {
|
||||
padding: 15rpx 10rpx;
|
||||
}
|
||||
.goods-panel-container view:not(:first-child) {
|
||||
border-top: 1px dashed #fff1f2;
|
||||
}
|
||||
@ -7,10 +7,6 @@
|
||||
</view>
|
||||
<view class="data-detail">{{item.detail}}</view>
|
||||
</view>
|
||||
<view tt:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.ttml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.ttml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
|
||||
121
sourcecode/toutiao/default/pages/plugins/points/index/index.js
Normal file
121
sourcecode/toutiao/default/pages/plugins/points/index/index.js
Normal file
@ -0,0 +1,121 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
avatar_default: app.data.default_user_head_src,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
user: app.get_user_cache_info(),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
var self = this;
|
||||
tt.request({
|
||||
url: app.get_request_url("index", "index", "points"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
tt.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
data_base: data.base || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
tt.stopPullDownRefresh();
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 立即登录
|
||||
login_event() {
|
||||
var user = app.get_user_info(this, "login_event")
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.user_is_need_login(user)) {
|
||||
tt.showModal({
|
||||
title: '温馨提示',
|
||||
content: '绑定手机号码',
|
||||
confirmText: '确认',
|
||||
cancelText: '暂不',
|
||||
success: (result) => {
|
||||
tt.stopPullDownRefresh();
|
||||
if (result.confirm) {
|
||||
tt.navigateTo({
|
||||
url: "/pages/login/login?event_callback=init"
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
this.setData({user: user || null});
|
||||
},
|
||||
|
||||
// 图片事件
|
||||
right_images_event(e) {
|
||||
if((this.data.data_base.right_images_url || null) != null)
|
||||
{
|
||||
tt.navigateTo({
|
||||
url: this.data.data_base.right_images_url,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.data.default_user_head_src != this.data.user.avatar) {
|
||||
tt.previewImage({
|
||||
current: this.data.user.avatar,
|
||||
urls: [this.data.user.avatar]
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data.data_base.seo_title || '积分商城 - '+app.data.application_title,
|
||||
desc: this.data.data_base.seo_desc || '积分抵扣、兑换 - '+app.data.application_describe,
|
||||
path: '/pages/plugins/signin/index-detail/index-detail?referrer=' + user_id
|
||||
};
|
||||
},
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#fe3e28",
|
||||
"backgroundColorTop": "#fe3e28",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarTitleText": "积分商城"
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
<view tt:if="{{(data_base || null) != null}}">
|
||||
<!-- 顶部 -->
|
||||
<view class="points-user tc">
|
||||
<navigator class="points-user-menu-submit" url="/pages/user-integral/user-integral" hover-class="none">我的积分</navigator>
|
||||
<block tt:if="{{(user || null) == null}}">
|
||||
<button type="default" size="mini" class="login-submit" bindtap="login_event">立即登录</button>
|
||||
<view class="user-desc">获知会员积分详情</view>
|
||||
</block>
|
||||
<block tt:else>
|
||||
<view class="avatar">
|
||||
<image bindtap="preview_event" src="{{user.avatar || avatar_default}}" mode="widthFix" class="dis-block" />
|
||||
</view>
|
||||
<view class="user-name">{{user.user_name_view}}</view>
|
||||
<view class="user-desc">当前可用 {{user.integral}} 积分</view>
|
||||
</block>
|
||||
|
||||
<!-- 按钮组 -->
|
||||
<view class="submit-container">
|
||||
<button type="default" size="mini" open-type="share" class="share-submit">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 广告图片 -->
|
||||
<image tt:if="{{(data_base.right_images || null) != null}}" src="{{data_base.right_images}}" class="wh-auto dis-block spacing-mt" mode="widthFix" bindtap="right_images_event" />
|
||||
|
||||
<!-- 公告信息 -->
|
||||
<view tt:if="{{(data_base.points_desc || null) != null && data_base.points_desc.length > 0}}" class="tips spacing-mt">
|
||||
<view tt:for="{{data_base.points_desc}}" tt:key="key" class="item">
|
||||
{{item}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品兑换 -->
|
||||
<view tt:if="{{(data_base.goods_exchange_data || null) != null && data_base.goods_exchange_data.length > 0}}" class="spacing-mt">
|
||||
<view class="spacing-nav-title">
|
||||
<text class="line"></text>
|
||||
<text class="text-wrapper">商品兑换</text>
|
||||
</view>
|
||||
<view class="data-list spacing-10">
|
||||
<view class="items bg-white" tt:for="{{data_base.goods_exchange_data}}" tt:key="key">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods.id}}" hover-class="none">
|
||||
<image src="{{item.goods.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.goods.title}}</view>
|
||||
<view class="price single-text original-price">{{currency_symbol}}{{item.goods.price}}</view>
|
||||
<view class="price single-text">
|
||||
<text class="unit">需</text>
|
||||
<text class="sales-price">{{item.integral}}</text>
|
||||
<text class="unit">积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.ttml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</view>
|
||||
<view tt:else>
|
||||
<import src="/pages/common/nodata.ttml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
107
sourcecode/toutiao/default/pages/plugins/points/index/index.ttss
Normal file
107
sourcecode/toutiao/default/pages/plugins/points/index/index.ttss
Normal file
@ -0,0 +1,107 @@
|
||||
/**
|
||||
* 顶部
|
||||
*/
|
||||
.points-user {
|
||||
background-color: #fe3e28;
|
||||
position: relative;
|
||||
padding: 100rpx 0 120rpx 0;
|
||||
}
|
||||
.points-user .avatar {
|
||||
padding: 1px;
|
||||
background: #ff9589;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.points-user .avatar,
|
||||
.points-user .avatar image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.points-user .user-name {
|
||||
color: #fff;
|
||||
margin: 10rpx 0 20rpx 0;
|
||||
}
|
||||
.points-user .user-desc {
|
||||
color: #ffe7b2;
|
||||
}
|
||||
.points-user-menu-submit {
|
||||
border: 1px solid #ffd606;
|
||||
color: #fae501;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
.submit-container {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.submit-container button:not(:first-child) {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
button.login-submit {
|
||||
color: #5eb95e;
|
||||
background-color: #E4F3E4;
|
||||
border-color: #d2e8d2;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.submit-container button.share-submit {
|
||||
color: #F37B1D;
|
||||
background-color: #ffe5be;
|
||||
border-color: #f8d093;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品导航
|
||||
*/
|
||||
.spacing-nav-title {
|
||||
color: #fe3e28;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
background: #fe3e28;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 80rpx);
|
||||
}
|
||||
.data-list {
|
||||
overflow: hidden;
|
||||
}
|
||||
.data-list .items {
|
||||
width: calc(50% - 5rpx);
|
||||
margin-bottom: 10rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.data-list .items:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
.data-list .items:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
.data-list .items image {
|
||||
width: 100%;
|
||||
height: 200px !important;
|
||||
}
|
||||
.data-list .items .base {
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
padding: 0 15rpx;
|
||||
}
|
||||
.data-list .items .base,
|
||||
.data-list .items .base .price {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.data-list .items .base .original-price {
|
||||
margin-left: 0;
|
||||
}
|
||||
.data-list .items .base .price .sales-price {
|
||||
margin: 0 5rpx;
|
||||
}
|
||||
.data-list .items .base .price .unit {
|
||||
color: #f40;
|
||||
}
|
||||
@ -55,8 +55,8 @@
|
||||
<image src="{{item.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view class="price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.min_price}}</text>
|
||||
<view class="price single-text">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
@ -75,7 +75,7 @@
|
||||
<text class="coming-tips-text">获得 <text>{{coming_integral}}</text> 积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.ttml" />
|
||||
|
||||
@ -97,6 +97,16 @@
|
||||
border-radius: 1000rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品导航
|
||||
*/
|
||||
.spacing-nav-title {
|
||||
color: #f6b015;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
background: #f6b015;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
<view class="content">
|
||||
<view class="data-card bg-white br-b" tt:for="{{data_list}}">
|
||||
<view class="data-box oh">
|
||||
<import src="/pages/common/nodata.ttml" />
|
||||
<text class="data-title">{{item.type_text}} {{item.operation_integral}}</text>
|
||||
<text class="data-time fr">{{item.add_time_time}}</text>
|
||||
</view>
|
||||
@ -12,10 +11,6 @@
|
||||
</view>
|
||||
<view class="data-detail">{{item.msg}}</view>
|
||||
</view>
|
||||
<view tt:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.ttml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.ttml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
|
||||
@ -78,7 +78,8 @@
|
||||
"pages/plugins/signin/user-qrcode/user-qrcode",
|
||||
"pages/plugins/signin/user-qrcode-detail/user-qrcode-detail",
|
||||
"pages/plugins/signin/user-qrcode-saveinfo/user-qrcode-saveinfo",
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list"
|
||||
"pages/plugins/signin/user-coming-list/user-coming-list",
|
||||
"pages/plugins/points/index/index"
|
||||
],
|
||||
"permission": {
|
||||
"scope.userLocation": {
|
||||
|
||||
@ -23,7 +23,7 @@
|
||||
}
|
||||
.data-list .items .title {
|
||||
margin-top: 10rpx;
|
||||
font-size: 32rpx;
|
||||
font-size: 30rpx;
|
||||
text-align:center;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
@ -33,13 +33,17 @@ Page({
|
||||
plugins_choice_coupon_value: [],
|
||||
popup_plugins_coupon_status: false,
|
||||
popup_plugins_coupon_index: null,
|
||||
|
||||
// 积分
|
||||
plugins_points_data: null,
|
||||
plugins_points_status: false,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
//params['data'] = '{"buy_type":"goods","goods_id":"1","stock":"1","spec":"[]"}';
|
||||
if((params.data || null) != null && app.get_length(JSON.parse(params.data)) > 0)
|
||||
if((params.data || null) != null && app.get_length(JSON.parse(decodeURIComponent(params.data))) > 0)
|
||||
{
|
||||
this.setData({ params: JSON.parse(params.data)});
|
||||
this.setData({ params: JSON.parse(decodeURIComponent(params.data))});
|
||||
|
||||
// 删除地址缓存
|
||||
wx.removeStorageSync(app.data.cache_buy_user_address_select_key);
|
||||
@ -107,7 +111,7 @@ Page({
|
||||
wx.request({
|
||||
url: app.get_request_url("index", "buy"),
|
||||
method: "POST",
|
||||
data: this.request_data_coupon_merge(data),
|
||||
data: this.request_data_ext_params_merge(data),
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
wx.stopPullDownRefresh();
|
||||
@ -126,6 +130,7 @@ Page({
|
||||
common_site_type: data.common_site_type || 0,
|
||||
extraction_address: data.base.extraction_address || [],
|
||||
plugins_coupon_data: data.plugins_coupon_data || null,
|
||||
plugins_points_data: data.plugins_points_data || null,
|
||||
});
|
||||
|
||||
// 优惠劵选择处理
|
||||
@ -182,8 +187,9 @@ Page({
|
||||
});
|
||||
},
|
||||
|
||||
// 请求参数合并优惠券参数
|
||||
request_data_coupon_merge(data) {
|
||||
// 请求参数合并
|
||||
request_data_ext_params_merge(data) {
|
||||
// 优惠券
|
||||
var coupon_ids = this.data.plugins_use_coupon_ids;
|
||||
if((coupon_ids || null) != null && coupon_ids.length > 0)
|
||||
{
|
||||
@ -192,6 +198,10 @@ Page({
|
||||
data['coupon_id_'+i] = coupon_ids[i];
|
||||
}
|
||||
}
|
||||
|
||||
// 积分
|
||||
data['is_points'] = (this.data.plugins_points_status === true) ? 1 : 0;
|
||||
|
||||
return data;
|
||||
},
|
||||
|
||||
@ -242,7 +252,7 @@ Page({
|
||||
wx.request({
|
||||
url: app.get_request_url("add", "buy"),
|
||||
method: "POST",
|
||||
data: this.request_data_coupon_merge(data),
|
||||
data: this.request_data_ext_params_merge(data),
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
wx.hideLoading();
|
||||
@ -384,4 +394,10 @@ Page({
|
||||
var address = (data.province_name || '') + (data.city_name || '') + (data.county_name || '') + (data.address || '');
|
||||
app.open_location(data.lng, data.lat, name, address);
|
||||
},
|
||||
|
||||
// 积分选择事件
|
||||
points_event(e) {
|
||||
this.setData({plugins_points_status: !this.data.plugins_points_status});
|
||||
this.init();
|
||||
},
|
||||
});
|
||||
|
||||
@ -90,6 +90,22 @@
|
||||
<view wx:else bindtap="bind_user_note_tap_event" class="{{(user_note_value || null) == null ? 'cr-888' : ''}}">{{user_note_value || '留言'}}</view>
|
||||
</view>
|
||||
|
||||
<!-- 积分 -->
|
||||
<view wx:if="{{(plugins_points_data || null) != null && (plugins_points_data.discount_price || 0) > 0}}" class="plugins-points-buy-container bg-white spacing-mb">
|
||||
<view class="select oh">
|
||||
<text wx:if="{{plugins_points_data.discount_type == 1}}">使用{{plugins_points_data.use_integral}}个积分兑换商品</text>
|
||||
<text wx:else>使用积分{{plugins_points_data.use_integral}}个</text>
|
||||
<text class="sales-price">-{{currency_symbol}}{{plugins_points_data.discount_price}}</text>
|
||||
<view bindtap="points_event" class="fr">
|
||||
<image class="icon" src="/images/default-select{{plugins_points_status ? '-active' : ''}}-icon.png" mode="widthFix" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<text wx:if="{{plugins_points_data.discount_type == 1}}">你有积分{{plugins_points_data.user_integral}}个</text>
|
||||
<text wx:else>你有积分{{plugins_points_data.user_integral}}个,可用{{plugins_points_data.use_integral}}个</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 支付方式 -->
|
||||
<view wx:if="{{payment_list.length > 0 && common_order_is_booking != 1}}" class="payment-list bg-white oh">
|
||||
<view class="item tc fl" wx:for="{{payment_list}}" wx:key="key">
|
||||
|
||||
@ -180,10 +180,10 @@
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
/**
|
||||
/*
|
||||
* 插件样式区域
|
||||
*/
|
||||
/**
|
||||
/*
|
||||
* 优惠劵
|
||||
*/
|
||||
.plugins-coupon {
|
||||
@ -209,4 +209,24 @@
|
||||
.coupon-container .not-use-tips {
|
||||
color: #f7b240;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 积分
|
||||
*/
|
||||
.plugins-points-buy-container {
|
||||
padding: 20rpx;
|
||||
}
|
||||
.plugins-points-buy-container .select .icon {
|
||||
width: 45rpx;
|
||||
height: 45rpx !important;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.plugins-points-buy-container .select .sales-price {
|
||||
margin-left: 30rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 400;
|
||||
}
|
||||
.plugins-points-buy-container .desc {
|
||||
color: #F37B1D;
|
||||
}
|
||||
@ -393,7 +393,7 @@ Page({
|
||||
"ids": ids.join(',')
|
||||
};
|
||||
wx.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
url: '/pages/buy/buy?data=' + encodeURIComponent(JSON.stringify(data))
|
||||
});
|
||||
},
|
||||
|
||||
|
||||
@ -629,7 +629,7 @@ Page({
|
||||
"spec": JSON.stringify(spec)
|
||||
};
|
||||
wx.navigateTo({
|
||||
url: '/pages/buy/buy?data=' + JSON.stringify(data)
|
||||
url: '/pages/buy/buy?data=' + encodeURIComponent(JSON.stringify(data))
|
||||
});
|
||||
this.popup_close_event();
|
||||
break;
|
||||
|
||||
@ -29,6 +29,23 @@
|
||||
<!-- 标题 -->
|
||||
<view class="goods-title multi-text" style="color:{{goods.title_color}}">{{goods.title}}</view>
|
||||
|
||||
<!-- 简述 -->
|
||||
<view wx:if="{{(goods.simple_desc || null) != null}}" class="goods-simple-desc">{{goods.simple_desc}}</view>
|
||||
|
||||
<!-- icon -->
|
||||
<view wx:if="{{(goods.plugins_view_icon_data || null) != null && goods.plugins_view_icon_data.length > 0}}" class="goods-icon-container bg-white br-b-dashed oh">
|
||||
<block wx:for="{{goods.plugins_view_icon_data}}" wx:key="key">
|
||||
<view wx:if="{{(item.name || null) != null}}" class="fl tc" style="{{(item.br_color || null) == null ? '' : 'border:1px solid '+item.br_color+';'}}{{(item.color || null) == null ? '' : 'color: '+item.color+';'}}">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 面板提示信息 -->
|
||||
<view wx:if="{{(goods.plugins_view_panel_data || null) != null && goods.plugins_view_panel_data.length > 0}}" class="goods-panel-container bg-white br-b-dashed oh">
|
||||
<block wx:for="{{goods.plugins_view_panel_data}}" wx:key="key">
|
||||
<view wx:if="{{(item || null) != null}}">{{item}}</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 限时秒杀 -->
|
||||
<view wx:if="{{plugins_limitedtimediscount_is_valid == 1}}">
|
||||
<import src="/pages/lib/limitedtimediscount/goods-detail.wxml" />
|
||||
|
||||
@ -363,4 +363,45 @@
|
||||
}
|
||||
.goods-parameters .content-item .item:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
|
||||
/*
|
||||
* 商品简述
|
||||
*/
|
||||
.goods-simple-desc {
|
||||
color: #f00;
|
||||
padding: 0 10rpx;
|
||||
margin: 5rpx 0 15rpx 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* icon
|
||||
*/
|
||||
.goods-icon-container {
|
||||
padding: 20rpx 10rpx 10rpx 10rpx;
|
||||
}
|
||||
.goods-icon-container view {
|
||||
background: #fff;
|
||||
border: 1px solid #3bb4f2;
|
||||
color: #3bb4f2;
|
||||
padding: 3rpx 15rpx;
|
||||
border-radius: 8rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
.goods-icon-container view:not(:last-child) {
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
/*
|
||||
* 面板
|
||||
*/
|
||||
.goods-panel-container {
|
||||
background: #fffbfc;
|
||||
color: #d2354c;
|
||||
}
|
||||
.goods-panel-container view {
|
||||
padding: 15rpx 10rpx;
|
||||
}
|
||||
.goods-panel-container view:not(:first-child) {
|
||||
border-top: 1px dashed #fff1f2;
|
||||
}
|
||||
@ -7,10 +7,6 @@
|
||||
</view>
|
||||
<view class="data-detail">{{item.detail}}</view>
|
||||
</view>
|
||||
<view wx:if="{{data_list.length == 0}}">
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status}}"></template>
|
||||
</view>
|
||||
</view>
|
||||
<import src="/pages/common/bottom_line.wxml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
|
||||
134
sourcecode/weixin/default/pages/plugins/points/index/index.js
Normal file
134
sourcecode/weixin/default/pages/plugins/points/index/index.js
Normal file
@ -0,0 +1,134 @@
|
||||
const app = getApp();
|
||||
Page({
|
||||
data: {
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
avatar_default: app.data.default_user_head_src,
|
||||
},
|
||||
|
||||
onLoad(params) {
|
||||
this.setData({
|
||||
params: params,
|
||||
user: app.get_user_cache_info(),
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
this.get_data();
|
||||
|
||||
// 显示分享菜单
|
||||
app.show_share_menu();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
get_data() {
|
||||
var self = this;
|
||||
wx.request({
|
||||
url: app.get_request_url("index", "index", "points"),
|
||||
method: "POST",
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: res => {
|
||||
wx.stopPullDownRefresh();
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
self.setData({
|
||||
data_base: data.base || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: true,
|
||||
});
|
||||
} else {
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
wx.stopPullDownRefresh();
|
||||
self.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: '服务器请求出错',
|
||||
});
|
||||
app.showToast("服务器请求出错");
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 下拉刷新
|
||||
onPullDownRefresh() {
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
// 立即登录
|
||||
login_event() {
|
||||
var user = app.get_user_info(this, "login_event")
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.user_is_need_login(user)) {
|
||||
wx.showModal({
|
||||
title: '温馨提示',
|
||||
content: '绑定手机号码',
|
||||
confirmText: '确认',
|
||||
cancelText: '暂不',
|
||||
success: (result) => {
|
||||
wx.stopPullDownRefresh();
|
||||
if (result.confirm) {
|
||||
wx.navigateTo({
|
||||
url: "/pages/login/login?event_callback=init"
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
this.setData({user: user || null});
|
||||
},
|
||||
|
||||
// 图片事件
|
||||
right_images_event(e) {
|
||||
if((this.data.data_base.right_images_url || null) != null)
|
||||
{
|
||||
wx.navigateTo({
|
||||
url: this.data.data_base.right_images_url,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 头像查看
|
||||
preview_event() {
|
||||
if (app.data.default_user_head_src != this.data.user.avatar) {
|
||||
wx.previewImage({
|
||||
current: this.data.user.avatar,
|
||||
urls: [this.data.user.avatar]
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 自定义分享
|
||||
onShareAppMessage() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data.data_base.seo_title || '积分商城 - '+app.data.application_title,
|
||||
desc: this.data.data_base.seo_desc || '积分抵扣、兑换 - '+app.data.application_describe,
|
||||
path: '/pages/plugins/signin/index-detail/index-detail?referrer=' + user_id
|
||||
};
|
||||
},
|
||||
|
||||
// 分享朋友圈
|
||||
onShareTimeline() {
|
||||
var user_id = app.get_user_cache_info('id', 0) || 0;
|
||||
return {
|
||||
title: this.data.data_base.seo_title || '积分商城 - '+app.data.application_title,
|
||||
query: 'referrer=' + user_id,
|
||||
imageUrl: this.data.data_base.right_images || ''
|
||||
};
|
||||
},
|
||||
});
|
||||
@ -0,0 +1,8 @@
|
||||
{
|
||||
"enablePullDownRefresh": true,
|
||||
"navigationBarBackgroundColor": "#fe3e28",
|
||||
"backgroundColorTop": "#fe3e28",
|
||||
"backgroundColorBottom": "#f5f5f5",
|
||||
"backgroundTextStyle": "light",
|
||||
"navigationBarTitleText": "积分商城"
|
||||
}
|
||||
@ -0,0 +1,64 @@
|
||||
<view wx:if="{{(data_base || null) != null}}">
|
||||
<!-- 顶部 -->
|
||||
<view class="points-user tc">
|
||||
<navigator class="points-user-menu-submit" url="/pages/user-integral/user-integral" hover-class="none">我的积分</navigator>
|
||||
<block wx:if="{{(user || null) == null}}">
|
||||
<button type="default" size="mini" class="login-submit" bindtap="login_event">立即登录</button>
|
||||
<view class="user-desc">获知会员积分详情</view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<view class="avatar">
|
||||
<image bindtap="preview_event" src="{{user.avatar || avatar_default}}" mode="widthFix" class="dis-block" />
|
||||
</view>
|
||||
<view class="user-name">{{user.user_name_view}}</view>
|
||||
<view class="user-desc">当前可用 {{user.integral}} 积分</view>
|
||||
</block>
|
||||
|
||||
<!-- 按钮组 -->
|
||||
<view class="submit-container">
|
||||
<button type="default" size="mini" open-type="share" class="share-submit">分享</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 广告图片 -->
|
||||
<image wx:if="{{(data_base.right_images || null) != null}}" src="{{data_base.right_images}}" class="wh-auto dis-block spacing-mt" mode="widthFix" bindtap="right_images_event" />
|
||||
|
||||
<!-- 公告信息 -->
|
||||
<view wx:if="{{(data_base.points_desc || null) != null && data_base.points_desc.length > 0}}" class="tips spacing-mt">
|
||||
<view wx:for="{{data_base.points_desc}}" wx:key="key" class="item">
|
||||
{{item}}
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 商品兑换 -->
|
||||
<view wx:if="{{(data_base.goods_exchange_data || null) != null && data_base.goods_exchange_data.length > 0}}" class="spacing-mt">
|
||||
<view class="spacing-nav-title">
|
||||
<text class="line"></text>
|
||||
<text class="text-wrapper">商品兑换</text>
|
||||
</view>
|
||||
<view class="data-list spacing-10">
|
||||
<view class="items bg-white" wx:for="{{data_base.goods_exchange_data}}" wx:key="key">
|
||||
<navigator url="/pages/goods-detail/goods-detail?goods_id={{item.goods.id}}" hover-class="none">
|
||||
<image src="{{item.goods.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.goods.title}}</view>
|
||||
<view class="price single-text original-price">{{currency_symbol}}{{item.goods.price}}</view>
|
||||
<view class="price single-text">
|
||||
<text class="unit">需</text>
|
||||
<text class="sales-price">{{item.integral}}</text>
|
||||
<text class="unit">积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.wxml" />
|
||||
<template is="bottom_line" data="{{status: data_bottom_line_status}}"></template>
|
||||
</view>
|
||||
<view wx:else>
|
||||
<import src="/pages/common/nodata.wxml" />
|
||||
<template is="nodata" data="{{status: data_list_loding_status, msg: data_list_loding_msg}}"></template>
|
||||
</view>
|
||||
107
sourcecode/weixin/default/pages/plugins/points/index/index.wxss
Normal file
107
sourcecode/weixin/default/pages/plugins/points/index/index.wxss
Normal file
@ -0,0 +1,107 @@
|
||||
/**
|
||||
* 顶部
|
||||
*/
|
||||
.points-user {
|
||||
background-color: #fe3e28;
|
||||
position: relative;
|
||||
padding: 100rpx 0 120rpx 0;
|
||||
}
|
||||
.points-user .avatar {
|
||||
padding: 1px;
|
||||
background: #ff9589;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.points-user .avatar,
|
||||
.points-user .avatar image {
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
.points-user .user-name {
|
||||
color: #fff;
|
||||
margin: 10rpx 0 20rpx 0;
|
||||
}
|
||||
.points-user .user-desc {
|
||||
color: #ffe7b2;
|
||||
}
|
||||
.points-user-menu-submit {
|
||||
border: 1px solid #ffd606;
|
||||
color: #fae501;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
right: 20rpx;
|
||||
padding: 6rpx 20rpx;
|
||||
border-radius: 3rpx;
|
||||
}
|
||||
.submit-container {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
right: 20rpx;
|
||||
}
|
||||
.submit-container button:not(:first-child) {
|
||||
margin-left: 30rpx;
|
||||
}
|
||||
button.login-submit {
|
||||
color: #5eb95e;
|
||||
background-color: #E4F3E4;
|
||||
border-color: #d2e8d2;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.submit-container button.share-submit {
|
||||
color: #F37B1D;
|
||||
background-color: #ffe5be;
|
||||
border-color: #f8d093;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品导航
|
||||
*/
|
||||
.spacing-nav-title {
|
||||
color: #fe3e28;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
background: #fe3e28;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
.scroll-box {
|
||||
height: calc(100vh - 80rpx);
|
||||
}
|
||||
.data-list {
|
||||
overflow: hidden;
|
||||
}
|
||||
.data-list .items {
|
||||
width: calc(50% - 5rpx);
|
||||
margin-bottom: 10rpx;
|
||||
padding-bottom: 20rpx;
|
||||
}
|
||||
.data-list .items:nth-child(2n) {
|
||||
float: right;
|
||||
}
|
||||
.data-list .items:nth-child(2n+1) {
|
||||
float: left;
|
||||
}
|
||||
.data-list .items image {
|
||||
width: 100%;
|
||||
height: 200px !important;
|
||||
}
|
||||
.data-list .items .base {
|
||||
text-align: left;
|
||||
font-size: 32rpx;
|
||||
padding: 0 15rpx;
|
||||
}
|
||||
.data-list .items .base,
|
||||
.data-list .items .base .price {
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
.data-list .items .base .original-price {
|
||||
margin-left: 0;
|
||||
}
|
||||
.data-list .items .base .price .sales-price {
|
||||
margin: 0 5rpx;
|
||||
}
|
||||
.data-list .items .base .price .unit {
|
||||
color: #f40;
|
||||
}
|
||||
@ -25,6 +25,9 @@ Page({
|
||||
|
||||
onShow() {
|
||||
this.get_data();
|
||||
|
||||
// 显示分享菜单
|
||||
app.show_share_menu();
|
||||
},
|
||||
|
||||
// 获取数据
|
||||
@ -76,8 +79,7 @@ Page({
|
||||
|
||||
// 初始化
|
||||
init() {
|
||||
var user = app.get_user_info(this, "init"),
|
||||
self = this;
|
||||
var user = app.get_user_info(this, "init");
|
||||
if (user != false) {
|
||||
// 用户未绑定用户则转到登录页面
|
||||
if (app.user_is_need_login(user)) {
|
||||
|
||||
@ -55,8 +55,8 @@
|
||||
<image src="{{item.images}}" mode="aspectFit" />
|
||||
<view class="base">
|
||||
<view class="multi-text">{{item.title}}</view>
|
||||
<view class="price">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.min_price}}</text>
|
||||
<view class="price single-text">
|
||||
<text class="sales-price">{{currency_symbol}}{{item.price}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
@ -75,7 +75,7 @@
|
||||
<text class="coming-tips-text">获得 <text>{{coming_integral}}</text> 积分</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 结尾 -->
|
||||
<import src="/pages/common/bottom_line.wxml" />
|
||||
|
||||
@ -97,6 +97,16 @@
|
||||
border-radius: 1000rpx;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品导航
|
||||
*/
|
||||
.spacing-nav-title {
|
||||
color: #f6b015;
|
||||
}
|
||||
.spacing-nav-title .line {
|
||||
background: #f6b015;
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品列表
|
||||
*/
|
||||
|
||||
@ -93,12 +93,12 @@ Page({
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
data_base: res.data.data.base || null,
|
||||
data_list: temp_data_list,
|
||||
data_total: res.data.data.total,
|
||||
data_page_total: res.data.data.page_total,
|
||||
data_list_loding_status: 3,
|
||||
data_page: this.data.data_page + 1,
|
||||
data_base: data.base || null,
|
||||
});
|
||||
|
||||
// 是否还有数据
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user