积分商城扫码领取积分
parent
c7fa3545dd
commit
1cb46febac
|
|
@ -137,6 +137,7 @@
|
|||
"plugins-signin-user-qrcode-saveinfo": "簽到碼編輯",
|
||||
"plugins-signin-user-coming-list": "用戶簽到",
|
||||
"plugins-points-index": "積分商城",
|
||||
"plugins-points-scan": "掃碼領積分",
|
||||
"plugins-brand-index": "品牌",
|
||||
"plugins-shop-index": "所有店鋪",
|
||||
"plugins-shop-detail": "店鋪首頁",
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@
|
|||
"plugins-signin-user-qrcode-saveinfo": "Sign in code editing",
|
||||
"plugins-signin-user-coming-list": "User check-in",
|
||||
"plugins-points-index": "Points Mall",
|
||||
"plugins-points-scan": "Scan the QR code to claim points",
|
||||
"plugins-brand-index": "brand",
|
||||
"plugins-shop-index": "All stores",
|
||||
"plugins-shop-detail": "Store homepage",
|
||||
|
|
|
|||
|
|
@ -137,6 +137,7 @@
|
|||
"plugins-signin-user-qrcode-saveinfo": "Edición del Código de registro",
|
||||
"plugins-signin-user-coming-list": "Registro de usuarios",
|
||||
"plugins-points-index": "Centro Comercial de puntos",
|
||||
"plugins-points-scan": "Escanear el Código para obtener puntos",
|
||||
"plugins-brand-index": "Marca",
|
||||
"plugins-shop-index": "Todas las tiendas",
|
||||
"plugins-shop-detail": "Página de inicio de la tienda",
|
||||
|
|
|
|||
|
|
@ -140,6 +140,7 @@
|
|||
"plugins-signin-user-qrcode-saveinfo": "签到码编辑",
|
||||
"plugins-signin-user-coming-list": "用户签到",
|
||||
"plugins-points-index": "积分商城",
|
||||
"plugins-points-scan": "扫码领积分",
|
||||
"plugins-brand-index": "品牌",
|
||||
"plugins-shop-index": "所有店铺",
|
||||
"plugins-shop-detail": "店铺首页",
|
||||
|
|
|
|||
|
|
@ -831,6 +831,13 @@
|
|||
"enablePullDownRefresh": true,
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "scan/scan",
|
||||
"style": {
|
||||
"enablePullDownRefresh": false,
|
||||
"navigationBarTitleText": ""
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
|
@ -0,0 +1,161 @@
|
|||
<template>
|
||||
<view :class="theme_view">
|
||||
<view v-if="(data || null) != null" :class="(user == null ? 'page-bottom-fixed' : '')">
|
||||
<block v-if="data.status == -10000">
|
||||
<!-- 顶部banner -->
|
||||
<image v-if="(data_base.scan_top_banner || null) != null" :src="data_base.scan_top_banner" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<!-- 底部图片 -->
|
||||
<image v-if="(data_base.scan_bottom_images || null) != null" :src="data_base.scan_bottom_images" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<!-- 结尾 -->
|
||||
<component-bottom-line :propStatus="data_bottom_line_status"></component-bottom-line>
|
||||
</block>
|
||||
<block v-else>
|
||||
<!-- 领取成功 -->
|
||||
<block v-if="data.status == 0">
|
||||
<image v-if="(data_base.scan_success_images || null) != null" :src="data_base.scan_success_images" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<view class="margin-vertical-xxxl tc">{{data.msg}}</view>
|
||||
</block>
|
||||
<!-- 领取失败 -->
|
||||
<block v-else-if="data.status == -100">
|
||||
<image v-if="(data_base.scan_fail_images || null) != null" :src="data_base.scan_fail_images" mode="widthFix" class="dis-block wh-auto auto"></image>
|
||||
<view class="margin-vertical-xxxl tc">{{data.msg}}</view>
|
||||
</block>
|
||||
<!-- 其他错误 -->
|
||||
<block v-else>
|
||||
<component-no-data propStatus="0" :propMsg="data.msg"></component-no-data>
|
||||
</block>
|
||||
</block>
|
||||
<!-- 未登录 -->
|
||||
<view v-if="user == null" class="pf left-0 bottom-xxxxl wh-auto tc padding-horizontal-main bs-bb">
|
||||
<view class="bottom-line-exclude">
|
||||
<button type="default" class="bg-main br-main cr-white text-size-sm round" @tap="login_event">{{$t('pages.login')}}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-else>
|
||||
<!-- 提示信息 -->
|
||||
<component-no-data :propStatus="data_list_loding_status" :propMsg="data_list_loding_msg"></component-no-data>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
const app = getApp();
|
||||
import componentNoData from '../../../../components/no-data/no-data';
|
||||
import componentBottomLine from '../../../../components/bottom-line/bottom-line';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
theme_view: app.globalData.get_theme_value_view(),
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 1,
|
||||
data_list_loding_msg: '',
|
||||
params: null,
|
||||
user: null,
|
||||
data_base: null,
|
||||
data: null,
|
||||
// 自定义分享信息
|
||||
share_info: {},
|
||||
};
|
||||
},
|
||||
|
||||
components: {
|
||||
componentNoData,
|
||||
componentBottomLine,
|
||||
},
|
||||
props: {},
|
||||
|
||||
onLoad(params) {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onload_handle(params);
|
||||
|
||||
// 设置参数
|
||||
this.setData({
|
||||
params: params,
|
||||
});
|
||||
},
|
||||
|
||||
onShow() {
|
||||
// 调用公共事件方法
|
||||
app.globalData.page_event_onshow_handle();
|
||||
|
||||
// 用户信息
|
||||
this.setData({
|
||||
user: app.globalData.get_user_cache_info(),
|
||||
});
|
||||
|
||||
// 获取数据
|
||||
this.get_data();
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 获取数据
|
||||
get_data() {
|
||||
uni.request({
|
||||
url: app.globalData.get_request_url('index', 'scan', 'points'),
|
||||
method: 'POST',
|
||||
data: this.params,
|
||||
dataType: 'json',
|
||||
success: (res) => {
|
||||
if (res.data.code == 0) {
|
||||
var data = res.data.data;
|
||||
this.setData({
|
||||
data_base: data.base || null,
|
||||
data: data.data || null,
|
||||
data_list_loding_msg: '',
|
||||
data_list_loding_status: 0,
|
||||
data_bottom_line_status: (data.data || null) != null,
|
||||
});
|
||||
|
||||
if ((this.data_base || null) != null) {
|
||||
// 基础自定义分享
|
||||
this.setData({
|
||||
share_info: {
|
||||
title: this.$t('pages.plugins-points-scan'),
|
||||
path: '/pages/plugins/points/scan/scan'
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: res.data.msg,
|
||||
});
|
||||
}
|
||||
// 分享菜单处理
|
||||
app.globalData.page_share_handle(this.share_info);
|
||||
},
|
||||
fail: () => {
|
||||
this.setData({
|
||||
data_bottom_line_status: false,
|
||||
data_list_loding_status: 2,
|
||||
data_list_loding_msg: this.$t('common.internet_error_tips'),
|
||||
});
|
||||
app.globalData.showToast(this.$t('common.internet_error_tips'));
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
// 登录事件
|
||||
login_event() {
|
||||
var user = app.globalData.get_user_info(this, 'login_event');
|
||||
if (user != false) {
|
||||
// 用户未绑定手机则转到登录页面
|
||||
if (app.globalData.user_is_need_login(user)) {
|
||||
uni.stopPullDownRefresh();
|
||||
uni.navigateTo({
|
||||
url: '/pages/login/login?event_callback=init',
|
||||
});
|
||||
}
|
||||
}
|
||||
this.setData({
|
||||
user: user || null,
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
@import './scan.css';
|
||||
</style>
|
||||
Loading…
Reference in New Issue