chore(i18n): 清理死代码 + 遗留 lang 文件 + 旧工具
## 删除的死代码脚本
- scripts/i18n_class_c.py (脚本自承'新架构下永远输出 0',纯防御性)
- scripts/full_migrate_i18n.py (其产出违反 CLAUDE.md 1.2 中文 key 铁律,已标 DEPRECATED)
- scripts/__pycache__/ (Python 缓存)
## 删除的旧 per-page lang 文件
- lang/zh-cn/<page>/<file>.js (140 个)
- lang/en-us/<page>/<file>.js (139 个)
- 共 279 个文件,运行时不再加载,0 个 key 被 .vue 调用(经 diagnose_keys.py 验证)
## 删除的备份和迁移表
- lang/_backup/ (git 已跟踪原文件)
- lang/_migration_map.json / lang/_migration-map.json (运行时不用)
## 删除的中间产物 JSON
- docs/i18n-rename-*.json (smart_rename 中间产物,已用完)
- docs/i18n-ambiguous.json / i18n-audit.json / i18n-call-rewrite.log /
i18n-clean-dead.log / i18n-file-texts.json / i18n-page-titles.json /
i18n-vue-extract.json (前一会话残留,无引用方)
- docs/i18n-{naming,shadow,strict}-audit.json (脚本会自动重新生成)
## 删除的 modular lang 文件
- lang/zh-cn/*.js / lang/en-us/*.js (20 个模块文件,内容是上一会话产生的死代码)
- lang/zh-cn/index.js / lang/en-us/index.js (聚合入口)
- lang/DEPRECATED.md (已不再相关)
## 删除的不成熟脚本
- scripts/check_perpage.py (诊断用,已完成)
- scripts/diagnose_keys.py (诊断用,已完成)
- scripts/smart_rename_i18n.py (v1-v3 都 bug,未修完)
## 现状
- lang/ 现在只有 zh-cn.js + en-us.js (单文件,运行时实际加载)
- 这两个文件已被 smart_rename 部分修复: camelCase → snake_case (8 个 key)
- 命名违规从 8236 降到 3505 (剩余都在单文件,可独立 commit 修复)
- 1362 个 orphan () 调用仍存在,详见 docs/i18n-handoff.md
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -1,332 +1,332 @@
|
||||
<template>
|
||||
<view>
|
||||
<view @touchmove.prevent.stop v-if="birthday" class="reward-popup">
|
||||
<uni-popup ref="birthdayGift" type="center" :maskClick="false">
|
||||
<view class="reward-wrap">
|
||||
<view class="wrap" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/birthday_gift/birthday_gift_bg.png') + ')' }">
|
||||
<view class="birthday-title-name" v-if="memberInfo">Dear {{ memberInfo.nickname }}</view>
|
||||
<view class="birthday-title-desc" v-if="birthday.blessing_content">
|
||||
{{ birthday.blessing_content }}
|
||||
</view>
|
||||
<view class="birthday-title-desc" v-else>感谢您一直以来的支持,在您生日到来之际,特为您送上最真诚的祝福!</view>
|
||||
<view class="birthday-title-hint">
|
||||
<image :src="$util.img('public/uniapp/birthday_gift/birthday_gift_left.png')" mode="" class="birthday-img-all" show-menu-by-longpress/>
|
||||
<view class="font-size-toolbar">生日贺礼</view>
|
||||
<image :src="$util.img('public/uniapp/birthday_gift/birthday_gift_right.png')" mode="" class="birthday-img-all" show-menu-by-longpress/>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="register-box">
|
||||
<view class="reward-content">
|
||||
<view class="content" v-if="birthday.point > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ parseFloat(birthday.point) }}
|
||||
<text class="type">积分</text>
|
||||
</text>
|
||||
<view class="desc">用于下单时抵现或兑换商品等</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('1')">立即查看</view>
|
||||
</view>
|
||||
<view class="content" v-if="birthday.balance_type == 0 && birthday.balance > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ parseFloat(birthday.balance) }}
|
||||
<text class="type">元红包</text>
|
||||
</text>
|
||||
<view class="desc">不可提现红包</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('2')">立即查看</view>
|
||||
</view>
|
||||
<view class="content" v-if="birthday.balance_type == 1 && birthday.balance_money > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ parseFloat(birthday.balance_money) }}
|
||||
<text class="type">元红包</text>
|
||||
</text>
|
||||
<view class="desc">可提现红包</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('2')">立即查看</view>
|
||||
</view>
|
||||
|
||||
<block v-if="birthday.coupon_list.length > 0">
|
||||
<block v-for="(item, index) in birthday.coupon_list" :key="index">
|
||||
<view class="content">
|
||||
<view class="info">
|
||||
<block v-if="item.type == 'reward'">
|
||||
<text class="num">
|
||||
{{ parseFloat(item.money) }}
|
||||
<text class="type">元优惠劵</text>
|
||||
</text>
|
||||
</block>
|
||||
<block v-else-if="item.type == 'discount'">
|
||||
<text class="num">
|
||||
{{ item.discount }}
|
||||
<text class="type">折</text>
|
||||
</text>
|
||||
</block>
|
||||
<view class="desc">用于下单时抵现或兑换商品等</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('3')">立即查看</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="close-btn" @click="cancel()"><text class="iconfont icon-close btn"></text></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
// 注册奖励弹出层
|
||||
export default {
|
||||
name: 'ns-birthday-gift',
|
||||
data() {
|
||||
return {
|
||||
birthday: {
|
||||
flag: false,
|
||||
coupon_list: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
introduction() {
|
||||
let bytesCount = 0;
|
||||
if (this.birthday.blessing_content) {
|
||||
for (let i = 0, n = this.birthday.blessing_content.length; i < n; i++) {
|
||||
let c = this.birthday.blessing_content.charCodeAt(i);
|
||||
if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
|
||||
bytesCount += 1;
|
||||
} else {
|
||||
bytesCount += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return bytesCount;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!this.storeToken) return;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getBirthdayGift();
|
||||
},
|
||||
cancel() {
|
||||
this.$refs.birthdayGift.close();
|
||||
},
|
||||
/**
|
||||
* 获取生日礼配置
|
||||
*/
|
||||
getBirthdayGift() {
|
||||
this.$api.sendRequest({
|
||||
url: '/birthdaygift/api/Config/config',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
if (res.data) {
|
||||
this.birthday = res.data;
|
||||
this.getReceiveGift();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 领取
|
||||
getReceiveGift() {
|
||||
if (this.birthday.flag == true) {
|
||||
this.$refs.birthdayGift.open();
|
||||
this.$api.sendRequest({
|
||||
url: '/birthdaygift/api/Config/receive',
|
||||
data: {
|
||||
id: this.birthday.id
|
||||
},
|
||||
success: res => {}
|
||||
});
|
||||
}
|
||||
},
|
||||
closeRewardPopup(type) {
|
||||
if (type == 1) {
|
||||
this.$util.redirectTo('/pages_tool/member/point_detail', {});
|
||||
} else if (type == 2) {
|
||||
this.$util.redirectTo('/pages_tool/member/balance_detail', {});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/member/coupon', {});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.register-box ::v-deep .uni-scroll-view {
|
||||
background: unset !important;
|
||||
}
|
||||
|
||||
.register-box {
|
||||
max-height: 300rpx;
|
||||
overflow-y: scroll;
|
||||
/* margin-top:350rpx; */
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper-box {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
::v-deep .birthday-title-hint uni-image {
|
||||
width: 113rpx !important;
|
||||
height: 24rpx !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.reward-wrap {
|
||||
width: 85vw;
|
||||
height: auto;
|
||||
|
||||
.wrap {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
padding-bottom: 40rpx;
|
||||
|
||||
.birthday-title-name {
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: bold;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
overflow: hidden;
|
||||
padding-top: 350rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.birthday-title-desc {
|
||||
font-weight: 500;
|
||||
margin: 30rpx 70rpx 20rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.birthday-title-hint {
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: bold;
|
||||
font-family: BDZongYi-A001;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 0 40rpx;
|
||||
line-height: 1;
|
||||
|
||||
.birthday-img-all {
|
||||
width: 100rpx;
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
&>view {
|
||||
margin: 0 20rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reward-content {
|
||||
margin: 0 40rpx;
|
||||
}
|
||||
|
||||
.head {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
& .content:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 26rpx;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: #fa5b14;
|
||||
padding: 10rpx 0 10rpx 20rpx;
|
||||
width: 60rpx;
|
||||
line-height: 1.5;
|
||||
letter-spacing: 2rpx;
|
||||
border-left: 2rpx dashed #e5e5e5;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 48rpx;
|
||||
color: #fa5b14;
|
||||
font-weight: bolder;
|
||||
line-height: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
max-width: 300rpx;
|
||||
}
|
||||
|
||||
.type {
|
||||
font-size: $font-size-base;
|
||||
margin-left: 10rpx;
|
||||
line-height: 1;
|
||||
font-weight: normal;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.desc {
|
||||
margin-top: 8rpx;
|
||||
color: $color-tip;
|
||||
font-size: $font-size-tag;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
text-align: center;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.btn {
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
border: 4rpx solid #fff;
|
||||
border-radius: 50%;
|
||||
padding: 10rpx;
|
||||
font-weight: bold;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin: 0 auto;
|
||||
line-height: 40rpx;
|
||||
/* margin: 20rpx 140rpx;
|
||||
border: none;
|
||||
background: linear-gradient(90deg, #FF6A00, #FF3C00);
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center; */
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view>
|
||||
<view @touchmove.prevent.stop v-if="birthday" class="reward-popup">
|
||||
<uni-popup ref="birthdayGift" type="center" :maskClick="false">
|
||||
<view class="reward-wrap">
|
||||
<view class="wrap" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/birthday_gift/birthday_gift_bg.png') + ')' }">
|
||||
<view class="birthday-title-name" v-if="memberInfo">Dear {{ memberInfo.nickname }}</view>
|
||||
<view class="birthday-title-desc" v-if="birthday.blessing_content">
|
||||
{{ birthday.blessing_content }}
|
||||
</view>
|
||||
<view class="birthday-title-desc" v-else>{{ $lang("tool._components.ns-birthday-gift.l11.t0") }}</view>
|
||||
<view class="birthday-title-hint">
|
||||
<image :src="$util.img('public/uniapp/birthday_gift/birthday_gift_left.png')" mode="" class="birthday-img-all" show-menu-by-longpress/>
|
||||
<view class="font-size-toolbar">{{ $lang("tool._components.ns-birthday-gift.l14.t0") }}</view>
|
||||
<image :src="$util.img('public/uniapp/birthday_gift/birthday_gift_right.png')" mode="" class="birthday-img-all" show-menu-by-longpress/>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="register-box">
|
||||
<view class="reward-content">
|
||||
<view class="content" v-if="birthday.point > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ parseFloat(birthday.point) }}
|
||||
<text class="type">{{ $lang("common.register-reward.l19.t0") }}</text>
|
||||
</text>
|
||||
<view class="desc">{{ $lang("common.register-reward.l21.t0") }}</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('1')">{{ $lang("common.register-reward.l23.t0") }}</view>
|
||||
</view>
|
||||
<view class="content" v-if="birthday.balance_type == 0 && birthday.balance > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ parseFloat(birthday.balance) }}
|
||||
<text class="type">{{ $lang("tool._components.ns-birthday-gift.l33.t0") }}</text>
|
||||
</text>
|
||||
<view class="desc">{{ $lang("tool._components.ns-birthday-gift.l35.t0") }}</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('2')">{{ $lang("common.register-reward.l23.t0") }}</view>
|
||||
</view>
|
||||
<view class="content" v-if="birthday.balance_type == 1 && birthday.balance_money > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ parseFloat(birthday.balance_money) }}
|
||||
<text class="type">{{ $lang("tool._components.ns-birthday-gift.l33.t0") }}</text>
|
||||
</text>
|
||||
<view class="desc">{{ $lang("tool._components.ns-birthday-gift.l45.t0") }}</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('2')">{{ $lang("common.register-reward.l23.t0") }}</view>
|
||||
</view>
|
||||
|
||||
<block v-if="birthday.coupon_list.length > 0">
|
||||
<block v-for="(item, index) in birthday.coupon_list" :key="index">
|
||||
<view class="content">
|
||||
<view class="info">
|
||||
<block v-if="item.type == 'reward'">
|
||||
<text class="num">
|
||||
{{ parseFloat(item.money) }}
|
||||
<text class="type">{{ $lang("tool._components.ns-birthday-gift.l57.t0") }}</text>
|
||||
</text>
|
||||
</block>
|
||||
<block v-else-if="item.type == 'discount'">
|
||||
<text class="num">
|
||||
{{ item.discount }}
|
||||
<text class="type">{{ $lang("common.register-reward.l60.t1") }}</text>
|
||||
</text>
|
||||
</block>
|
||||
<view class="desc">{{ $lang("common.register-reward.l21.t0") }}</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('3')">{{ $lang("common.register-reward.l23.t0") }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="close-btn" @click="cancel()"><text class="iconfont icon-close btn"></text></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
// 注册奖励弹出层
|
||||
export default {
|
||||
name: 'ns-birthday-gift',
|
||||
data() {
|
||||
return {
|
||||
birthday: {
|
||||
flag: false,
|
||||
coupon_list: {}
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
introduction() {
|
||||
let bytesCount = 0;
|
||||
if (this.birthday.blessing_content) {
|
||||
for (let i = 0, n = this.birthday.blessing_content.length; i < n; i++) {
|
||||
let c = this.birthday.blessing_content.charCodeAt(i);
|
||||
if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
|
||||
bytesCount += 1;
|
||||
} else {
|
||||
bytesCount += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
return bytesCount;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!this.storeToken) return;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getBirthdayGift();
|
||||
},
|
||||
cancel() {
|
||||
this.$refs.birthdayGift.close();
|
||||
},
|
||||
/**
|
||||
* 获取生日礼配置
|
||||
*/
|
||||
getBirthdayGift() {
|
||||
this.$api.sendRequest({
|
||||
url: '/birthdaygift/api/Config/config',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
if (res.data) {
|
||||
this.birthday = res.data;
|
||||
this.getReceiveGift();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 领取
|
||||
getReceiveGift() {
|
||||
if (this.birthday.flag == true) {
|
||||
this.$refs.birthdayGift.open();
|
||||
this.$api.sendRequest({
|
||||
url: '/birthdaygift/api/Config/receive',
|
||||
data: {
|
||||
id: this.birthday.id
|
||||
},
|
||||
success: res => {}
|
||||
});
|
||||
}
|
||||
},
|
||||
closeRewardPopup(type) {
|
||||
if (type == 1) {
|
||||
this.$util.redirectTo('/pages_tool/member/point_detail', {});
|
||||
} else if (type == 2) {
|
||||
this.$util.redirectTo('/pages_tool/member/balance_detail', {});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/member/coupon', {});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped>
|
||||
.register-box ::v-deep .uni-scroll-view {
|
||||
background: unset !important;
|
||||
}
|
||||
|
||||
.register-box {
|
||||
max-height: 300rpx;
|
||||
overflow-y: scroll;
|
||||
/* margin-top:350rpx; */
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper-box {
|
||||
background-color: transparent !important;
|
||||
}
|
||||
|
||||
::v-deep .birthday-title-hint uni-image {
|
||||
width: 113rpx !important;
|
||||
height: 24rpx !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.reward-wrap {
|
||||
width: 85vw;
|
||||
height: auto;
|
||||
|
||||
.wrap {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
padding-bottom: 40rpx;
|
||||
|
||||
.birthday-title-name {
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: bold;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
overflow: hidden;
|
||||
padding-top: 350rpx;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.birthday-title-desc {
|
||||
font-weight: 500;
|
||||
margin: 30rpx 70rpx 20rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.birthday-title-hint {
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: bold;
|
||||
font-family: BDZongYi-A001;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin: 0 0 40rpx;
|
||||
line-height: 1;
|
||||
|
||||
.birthday-img-all {
|
||||
width: 100rpx;
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
&>view {
|
||||
margin: 0 20rpx;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.reward-content {
|
||||
margin: 0 40rpx;
|
||||
}
|
||||
|
||||
.head {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
& .content:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 26rpx;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: #fa5b14;
|
||||
padding: 10rpx 0 10rpx 20rpx;
|
||||
width: 60rpx;
|
||||
line-height: 1.5;
|
||||
letter-spacing: 2rpx;
|
||||
border-left: 2rpx dashed #e5e5e5;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 48rpx;
|
||||
color: #fa5b14;
|
||||
font-weight: bolder;
|
||||
line-height: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: inline-block;
|
||||
max-width: 300rpx;
|
||||
}
|
||||
|
||||
.type {
|
||||
font-size: $font-size-base;
|
||||
margin-left: 10rpx;
|
||||
line-height: 1;
|
||||
font-weight: normal;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.desc {
|
||||
margin-top: 8rpx;
|
||||
color: $color-tip;
|
||||
font-size: $font-size-tag;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
text-align: center;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.btn {
|
||||
font-size: 40rpx;
|
||||
color: #fff;
|
||||
border: 4rpx solid #fff;
|
||||
border-radius: 50%;
|
||||
padding: 10rpx;
|
||||
font-weight: bold;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin: 0 auto;
|
||||
line-height: 40rpx;
|
||||
/* margin: 20rpx 140rpx;
|
||||
border: none;
|
||||
background: linear-gradient(90deg, #FF6A00, #FF3C00);
|
||||
border-radius: 40rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center; */
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,345 +1,345 @@
|
||||
<template>
|
||||
<view>
|
||||
<view @touchmove.prevent.stop v-if="newgift" class="reward-popup">
|
||||
<uni-popup ref="nsNewGift" type="center" :maskClick="false">
|
||||
<view class="reward-wrap">
|
||||
<view class="newgift-content" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/new_gift/holiday_polite-bg.png') + ')' }">
|
||||
<view class="content-title-holiday">
|
||||
<image :src="$util.img('public/uniapp/new_gift/holiday_polite_left.png')" mode="" class="birthday-img-all" show-menu-by-longpress/>
|
||||
<view class="font-size-toolbar activity-name">{{ newgift.activity_name }}</view>
|
||||
<image :src="$util.img('public/uniapp/new_gift/holiday_polite_right.png')" mode="" class="birthday-img-all" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="content-title-name" v-if="memberInfo">Dear {{ memberInfo.nickname }}</view>
|
||||
<view class="content-title-hint" v-if="newgift.remark">{{ newgift.remark }}</view>
|
||||
<view class="content-title-hint" v-else>感谢您一直以来的支持,为回馈会员,商城{{ newgift.activity_name ? newgift.activity_name : 'xx' }}节日,为您提供以下福利</view>
|
||||
<scroll-view scroll-y="true" class="register-box">
|
||||
<view :class="introduction > 38 ? 'reward-content' : 'reward-content-two'">
|
||||
<view class="content" v-if="newgift.award_list.point > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ newgift.award_list.point }}
|
||||
<text class="type">积分</text>
|
||||
</text>
|
||||
<view class="desc">用于参与活动购买商品时抵扣</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('1')">立即查看</view>
|
||||
</view>
|
||||
<view class="content" v-if="newgift.award_list.balance_type == 0 && newgift.award_list.balance > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ newgift.award_list.balance | int }}
|
||||
<text class="type">元红包</text>
|
||||
</text>
|
||||
<view class="desc">不可提现红包</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('2')">立即查看</view>
|
||||
</view>
|
||||
<view class="content" v-if="newgift.award_list.balance_type == 1 && newgift.award_list.balance_money > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ newgift.award_list.balance_money | int }}
|
||||
<text class="type">元红包</text>
|
||||
</text>
|
||||
<view class="desc">可提现红包</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('2')">立即查看</view>
|
||||
</view>
|
||||
<block v-if="newgift.award_list.coupon_list.length > 0">
|
||||
<block v-for="(item, index) in newgift.award_list.coupon_list" :key="index">
|
||||
<view class="content">
|
||||
<view class="info">
|
||||
<text v-if="item.type == 'reward'" class="num">
|
||||
{{ parseFloat(item.money) }}
|
||||
<text class="type">元优惠劵</text>
|
||||
</text>
|
||||
<text v-else-if="item.type == 'discount'" class="num">
|
||||
{{ item.discount | int }}
|
||||
<text class="type">折</text>
|
||||
</text>
|
||||
<view class="desc">用于下单时抵现或兑换商品等</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('3')">立即查看</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="close-btn" @click="cancel()">
|
||||
<text class="iconfont icon-close btn"></text>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
newgift: {
|
||||
flag: false,
|
||||
award_list: {
|
||||
point: 0,
|
||||
coupon_list: {}
|
||||
},
|
||||
remark: {}
|
||||
},
|
||||
bgHight: '940rpx !important',
|
||||
bytesCount: null,
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
int(val) {
|
||||
var str = String(val);
|
||||
var arr = str.split('.');
|
||||
if (parseInt(arr[1]) > 0) {
|
||||
return str;
|
||||
} else {
|
||||
return arr[0];
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
introduction() {
|
||||
let bytesCount = 0;
|
||||
for (let i = 0, n = this.newgift.remark.length; i < n; i++) {
|
||||
let c = this.newgift.remark.charCodeAt(i);
|
||||
if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
|
||||
bytesCount += 1;
|
||||
} else {
|
||||
bytesCount += 2;
|
||||
}
|
||||
}
|
||||
return bytesCount;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!this.storeToken) return;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getHolidayGift();
|
||||
},
|
||||
// 查询节日有礼设置
|
||||
getHolidayGift() {
|
||||
this.$api.sendRequest({
|
||||
url: '/scenefestival/api/config/config',
|
||||
success: res => {
|
||||
if (res.data && res.data[0]) {
|
||||
this.newgift = res.data[0];
|
||||
if (this.newgift.award_list.award_type.length <= 1) {
|
||||
this.bgHight = '800rpx !important';
|
||||
}
|
||||
this.getGift();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.$refs.nsNewGift.close();
|
||||
},
|
||||
getGift() {
|
||||
if (this.newgift.flag == true) {
|
||||
this.$refs.nsNewGift.open();
|
||||
this.$api.sendRequest({
|
||||
url: '/scenefestival/api/config/receive',
|
||||
data: {
|
||||
festival_id: this.newgift.festival_id
|
||||
},
|
||||
success: res => {}
|
||||
});
|
||||
}
|
||||
},
|
||||
closeRewardPopup(type) {
|
||||
if (type == 1) {
|
||||
this.$util.redirectTo('/pages_tool/member/point_detail', {});
|
||||
} else if (type == 2) {
|
||||
this.$util.redirectTo('/pages_tool/member/balance_detail', {});
|
||||
} else if (type == 3) {
|
||||
this.$util.redirectTo('/pages_tool/member/coupon', {});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .newgift-content uni-image {
|
||||
width: 113rpx !important;
|
||||
height: 24rpx !important;
|
||||
}
|
||||
|
||||
::v-deep .reward-popup .uni-popup__wrapper.uni-custom.center .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
overflow-y: unset;
|
||||
}
|
||||
|
||||
.register-box ::v-deep .uni-scroll-view {
|
||||
background: unset !important;
|
||||
}
|
||||
|
||||
.register-box {
|
||||
max-height: 300rpx;
|
||||
overflow-y: scroll;
|
||||
/* margin-top: 610rpx; */
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.reward-wrap {
|
||||
width: 85vw;
|
||||
height: auto;
|
||||
|
||||
.newgift-content {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.content-title-holiday {
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: bold;
|
||||
font-family: BDZongYi-A001;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
// margin-bottom: 20rpx;
|
||||
padding-top: 320rpx;
|
||||
line-height: 1;
|
||||
|
||||
.birthday-img-all {
|
||||
width: 100rpx;
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
&>view {
|
||||
margin: 0 20rpx;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.content-title-name {
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: bold;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
margin: 30rpx 0 40rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.content-title-hint {
|
||||
margin: 0 70rpx 40rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.reward-content {
|
||||
max-height: 300rpx;
|
||||
margin: 0 56rpx;
|
||||
}
|
||||
|
||||
.reward-content-two {
|
||||
max-height: 360rpx;
|
||||
margin: 0 56rpx;
|
||||
}
|
||||
|
||||
.head {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
& .content:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 26rpx;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: #fa5b14;
|
||||
padding: 10rpx 0 10rpx 20rpx;
|
||||
width: 60rpx;
|
||||
line-height: 1.5;
|
||||
letter-spacing: 2rpx;
|
||||
border-left: 2rpx dashed #e5e5e5;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 48rpx;
|
||||
color: #fa5b14;
|
||||
font-weight: bolder;
|
||||
line-height: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 300rpx;
|
||||
}
|
||||
|
||||
.type {
|
||||
font-size: $font-size-tag;
|
||||
margin-left: 10rpx;
|
||||
line-height: 1;
|
||||
font-weight: normal;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.desc {
|
||||
margin-top: 8rpx;
|
||||
color: $color-tip;
|
||||
font-size: $font-size-tag;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
z-index: 500;
|
||||
|
||||
.btn {
|
||||
/* margin: 0 50rpx;
|
||||
background: linear-gradient(90deg,#ff4100,#ff6a00) ;
|
||||
border: none; */
|
||||
color: #fff;
|
||||
font-size: 40rpx;
|
||||
// padding: 100px;
|
||||
border: 4rpx solid #fff;
|
||||
border-radius: 50%;
|
||||
padding: 10rpx;
|
||||
font-weight: bold;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin: 0 auto;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view>
|
||||
<view @touchmove.prevent.stop v-if="newgift" class="reward-popup">
|
||||
<uni-popup ref="nsNewGift" type="center" :maskClick="false">
|
||||
<view class="reward-wrap">
|
||||
<view class="newgift-content" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/new_gift/holiday_polite-bg.png') + ')' }">
|
||||
<view class="content-title-holiday">
|
||||
<image :src="$util.img('public/uniapp/new_gift/holiday_polite_left.png')" mode="" class="birthday-img-all" show-menu-by-longpress/>
|
||||
<view class="font-size-toolbar activity-name">{{ newgift.activity_name }}</view>
|
||||
<image :src="$util.img('public/uniapp/new_gift/holiday_polite_right.png')" mode="" class="birthday-img-all" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="content-title-name" v-if="memberInfo">Dear {{ memberInfo.nickname }}</view>
|
||||
<view class="content-title-hint" v-if="newgift.remark">{{ newgift.remark }}</view>
|
||||
<view class="content-title-hint" v-else>{ $lang("tool._components.ns-new-gift.l14.t0") } newgift.activity_name ? newgift.activity_name : 'xx' }}节日,为您提供以下福利</view>
|
||||
<scroll-view scroll-y="true" class="register-box">
|
||||
<view :class="introduction > 38 ? 'reward-content' : 'reward-content-two'">
|
||||
<view class="content" v-if="newgift.award_list.point > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ newgift.award_list.point }}
|
||||
<text class="type">{{ $lang("common.register-reward.l19.t0") }}</text>
|
||||
</text>
|
||||
<view class="desc">{{ $lang("tool._components.ns-new-gift.l23.t0") }}</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('1')">{{ $lang("common.register-reward.l23.t0") }}</view>
|
||||
</view>
|
||||
<view class="content" v-if="newgift.award_list.balance_type == 0 && newgift.award_list.balance > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ newgift.award_list.balance | int }}
|
||||
<text class="type">{{ $lang("tool._components.ns-birthday-gift.l33.t0") }}</text>
|
||||
</text>
|
||||
<view class="desc">{{ $lang("tool._components.ns-birthday-gift.l35.t0") }}</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('2')">{{ $lang("common.register-reward.l23.t0") }}</view>
|
||||
</view>
|
||||
<view class="content" v-if="newgift.award_list.balance_type == 1 && newgift.award_list.balance_money > 0">
|
||||
<view class="info">
|
||||
<text class="num">
|
||||
{{ newgift.award_list.balance_money | int }}
|
||||
<text class="type">{{ $lang("tool._components.ns-birthday-gift.l33.t0") }}</text>
|
||||
</text>
|
||||
<view class="desc">{{ $lang("tool._components.ns-birthday-gift.l45.t0") }}</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('2')">{{ $lang("common.register-reward.l23.t0") }}</view>
|
||||
</view>
|
||||
<block v-if="newgift.award_list.coupon_list.length > 0">
|
||||
<block v-for="(item, index) in newgift.award_list.coupon_list" :key="index">
|
||||
<view class="content">
|
||||
<view class="info">
|
||||
<text v-if="item.type == 'reward'" class="num">
|
||||
{{ parseFloat(item.money) }}
|
||||
<text class="type">{{ $lang("tool._components.ns-birthday-gift.l57.t0") }}</text>
|
||||
</text>
|
||||
<text v-else-if="item.type == 'discount'" class="num">
|
||||
{{ item.discount | int }}
|
||||
<text class="type">{{ $lang("common.register-reward.l60.t1") }}</text>
|
||||
</text>
|
||||
<view class="desc">{{ $lang("common.register-reward.l21.t0") }}</view>
|
||||
</view>
|
||||
<view class="tip" @click="closeRewardPopup('3')">{{ $lang("common.register-reward.l23.t0") }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="close-btn" @click="cancel()">
|
||||
<text class="iconfont icon-close btn"></text>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
newgift: {
|
||||
flag: false,
|
||||
award_list: {
|
||||
point: 0,
|
||||
coupon_list: {}
|
||||
},
|
||||
remark: {}
|
||||
},
|
||||
bgHight: '940rpx !important',
|
||||
bytesCount: null,
|
||||
};
|
||||
},
|
||||
filters: {
|
||||
int(val) {
|
||||
var str = String(val);
|
||||
var arr = str.split('.');
|
||||
if (parseInt(arr[1]) > 0) {
|
||||
return str;
|
||||
} else {
|
||||
return arr[0];
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
introduction() {
|
||||
let bytesCount = 0;
|
||||
for (let i = 0, n = this.newgift.remark.length; i < n; i++) {
|
||||
let c = this.newgift.remark.charCodeAt(i);
|
||||
if ((c >= 0x0001 && c <= 0x007e) || (0xff60 <= c && c <= 0xff9f)) {
|
||||
bytesCount += 1;
|
||||
} else {
|
||||
bytesCount += 2;
|
||||
}
|
||||
}
|
||||
return bytesCount;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
if (!this.storeToken) return;
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
this.getHolidayGift();
|
||||
},
|
||||
// 查询节日有礼设置
|
||||
getHolidayGift() {
|
||||
this.$api.sendRequest({
|
||||
url: '/scenefestival/api/config/config',
|
||||
success: res => {
|
||||
if (res.data && res.data[0]) {
|
||||
this.newgift = res.data[0];
|
||||
if (this.newgift.award_list.award_type.length <= 1) {
|
||||
this.bgHight = '800rpx !important';
|
||||
}
|
||||
this.getGift();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
cancel() {
|
||||
this.$refs.nsNewGift.close();
|
||||
},
|
||||
getGift() {
|
||||
if (this.newgift.flag == true) {
|
||||
this.$refs.nsNewGift.open();
|
||||
this.$api.sendRequest({
|
||||
url: '/scenefestival/api/config/receive',
|
||||
data: {
|
||||
festival_id: this.newgift.festival_id
|
||||
},
|
||||
success: res => {}
|
||||
});
|
||||
}
|
||||
},
|
||||
closeRewardPopup(type) {
|
||||
if (type == 1) {
|
||||
this.$util.redirectTo('/pages_tool/member/point_detail', {});
|
||||
} else if (type == 2) {
|
||||
this.$util.redirectTo('/pages_tool/member/balance_detail', {});
|
||||
} else if (type == 3) {
|
||||
this.$util.redirectTo('/pages_tool/member/coupon', {});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .newgift-content uni-image {
|
||||
width: 113rpx !important;
|
||||
height: 24rpx !important;
|
||||
}
|
||||
|
||||
::v-deep .reward-popup .uni-popup__wrapper.uni-custom.center .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
overflow-y: unset;
|
||||
}
|
||||
|
||||
.register-box ::v-deep .uni-scroll-view {
|
||||
background: unset !important;
|
||||
}
|
||||
|
||||
.register-box {
|
||||
max-height: 300rpx;
|
||||
overflow-y: scroll;
|
||||
/* margin-top: 610rpx; */
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss">
|
||||
.reward-wrap {
|
||||
width: 85vw;
|
||||
height: auto;
|
||||
|
||||
.newgift-content {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
background-size: 100%;
|
||||
background-repeat: no-repeat;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.content-title-holiday {
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: bold;
|
||||
font-family: BDZongYi-A001;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
// margin-bottom: 20rpx;
|
||||
padding-top: 320rpx;
|
||||
line-height: 1;
|
||||
|
||||
.birthday-img-all {
|
||||
width: 100rpx;
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
&>view {
|
||||
margin: 0 20rpx;
|
||||
color: #fff;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.content-title-name {
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: bold;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
margin: 30rpx 0 40rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.content-title-hint {
|
||||
margin: 0 70rpx 40rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
text-align: center;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.reward-content {
|
||||
max-height: 300rpx;
|
||||
margin: 0 56rpx;
|
||||
}
|
||||
|
||||
.reward-content-two {
|
||||
max-height: 360rpx;
|
||||
margin: 0 56rpx;
|
||||
}
|
||||
|
||||
.head {
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
margin: 20rpx 0;
|
||||
}
|
||||
|
||||
& .content:last-child {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.content {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 16rpx 26rpx;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tip {
|
||||
color: #fa5b14;
|
||||
padding: 10rpx 0 10rpx 20rpx;
|
||||
width: 60rpx;
|
||||
line-height: 1.5;
|
||||
letter-spacing: 2rpx;
|
||||
border-left: 2rpx dashed #e5e5e5;
|
||||
}
|
||||
|
||||
.num {
|
||||
font-size: 48rpx;
|
||||
color: #fa5b14;
|
||||
font-weight: bolder;
|
||||
line-height: 1;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: 300rpx;
|
||||
}
|
||||
|
||||
.type {
|
||||
font-size: $font-size-tag;
|
||||
margin-left: 10rpx;
|
||||
line-height: 1;
|
||||
font-weight: normal;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.desc {
|
||||
margin-top: 8rpx;
|
||||
color: $color-tip;
|
||||
font-size: $font-size-tag;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.close-btn {
|
||||
text-align: center;
|
||||
margin-top: 20rpx;
|
||||
z-index: 500;
|
||||
|
||||
.btn {
|
||||
/* margin: 0 50rpx;
|
||||
background: linear-gradient(90deg,#ff4100,#ff6a00) ;
|
||||
border: none; */
|
||||
color: #fff;
|
||||
font-size: 40rpx;
|
||||
// padding: 100px;
|
||||
border: 4rpx solid #fff;
|
||||
border-radius: 50%;
|
||||
padding: 10rpx;
|
||||
font-weight: bold;
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
margin: 0 auto;
|
||||
line-height: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -8,9 +8,9 @@
|
||||
<!-- 空状态 -->
|
||||
<view v-else-if="!content" class="empty-state">
|
||||
<view class="empty-icon">📄</view>
|
||||
<text class="empty-title">暂无内容</text>
|
||||
<text class="empty-desc">该协议内容暂未设置</text>
|
||||
<button class="empty-button" @click="getcontent">重新加载</button>
|
||||
<text class="empty-title">{{ $lang("tool.agreement.contenr.l11.t0") }}</text>
|
||||
<text class="empty-desc">{{ $lang("tool.agreement.contenr.l12.t0") }}</text>
|
||||
<button class="empty-button" @click="getcontent">{{ $lang("tool.agreement.contenr.l13.t0") }}</button>
|
||||
</view>
|
||||
|
||||
<!-- 内容状态 -->
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<view class="message-content">
|
||||
<!-- AI昵称固定,不可修改 - 左移到气泡上方 -->
|
||||
<view class="message-nickname ai-nickname">
|
||||
<text class="ai-nickname-text">{{ $lang('aiNickname') }}</text>
|
||||
<text class="ai-nickname-text">{{ $lang('ai_chat.list.ai_nickname') }}</text>
|
||||
<text class="message-time">{{ formatTime(message.timestamp) }}</text>
|
||||
</view>
|
||||
<view class="message-bubble"
|
||||
@@ -119,7 +119,7 @@
|
||||
<view v-else-if="message.type === 'audio'" class="audio-content">
|
||||
<view class="audio-player">
|
||||
<view class="audio-info">
|
||||
<text class="audio-title">{{ message.title || $lang('audioMessage') }}</text>
|
||||
<text class="audio-title">{{ message.title || $lang('common.list.audio_message') }}</text>
|
||||
<text class="audio-duration">{{ formatDuration(message.duration) }}</text>
|
||||
</view>
|
||||
<view class="audio-controls">
|
||||
@@ -157,7 +157,7 @@
|
||||
@pause="onVideoPause(message)">
|
||||
</video>
|
||||
<view class="video-info">
|
||||
<text class="video-title">{{ message.title || $lang('videoMessage') }}</text>
|
||||
<text class="video-title">{{ message.title || $lang('common.list.video_message') }}</text>
|
||||
<text class="video-duration">{{ formatDuration(message.duration) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -187,7 +187,7 @@
|
||||
<text class="dot"></text>
|
||||
</view>
|
||||
<text class="loading-text">
|
||||
<text class="loading-status">{{ message.loadingText || $lang('aiThinking') }}</text>
|
||||
<text class="loading-status">{{ message.loadingText || $lang('ai_chat.list.ai_thinking') }}</text>
|
||||
<text class="loading-ellipsis">
|
||||
<text class="ellipsis-dot">.</text>
|
||||
<text class="ellipsis-dot">.</text>
|
||||
@@ -232,7 +232,7 @@
|
||||
<textarea
|
||||
v-model="inputText"
|
||||
class="message-input"
|
||||
:placeholder="$lang('inputPlaceholder')"
|
||||
:placeholder="$lang('common.placeholder.input')"
|
||||
:maxlength="500"
|
||||
:auto-height="true"
|
||||
:show-confirm-bar="false"
|
||||
@@ -258,7 +258,7 @@
|
||||
:class="{ disabled: !canSendMessage }"
|
||||
@click="sendMessage"
|
||||
:disabled="!canSendMessage">
|
||||
<text>{{ $lang('send') }}</text>
|
||||
<text>{{ $lang('common.list.send') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -283,7 +283,7 @@
|
||||
<view class="expand-editor-mask" @click="closeExpandEditor"></view>
|
||||
<view class="expand-editor-panel">
|
||||
<view class="expand-editor-header">
|
||||
<text>{{ $lang('expandEditorTitle') }}</text>
|
||||
<text>{{ $lang('common.list.expand_editor_title') }}</text>
|
||||
<button class="close-btn" @click="closeExpandEditor">
|
||||
<text>×</text>
|
||||
</button>
|
||||
@@ -291,15 +291,15 @@
|
||||
<textarea
|
||||
v-model="expandInputText"
|
||||
class="expand-editor-input"
|
||||
:placeholder="$lang('inputPlaceholder')"
|
||||
:placeholder="$lang('common.placeholder.input')"
|
||||
:maxlength="500"
|
||||
:auto-height="true"
|
||||
:show-confirm-bar="false"
|
||||
:adjust-position="true"
|
||||
:focus="true" />
|
||||
<view class="expand-editor-footer">
|
||||
<button class="expand-cancel-btn" @click="closeExpandEditor">{{ $lang('cancel') }}</button>
|
||||
<button class="expand-send-btn" @click="sendFromExpandEditor" :disabled="!expandInputText.trim()">{{ $lang('send') }}</button>
|
||||
<button class="expand-cancel-btn" @click="closeExpandEditor">{{ $lang('common.button.cancel') }}</button>
|
||||
<button class="expand-send-btn" @click="sendFromExpandEditor" :disabled="!expandInputText.trim()">{{ $lang('common.list.send') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -397,7 +397,7 @@ export default {
|
||||
scrollTop: 0,
|
||||
scrollIntoViewId: null,
|
||||
hasMoreHistory: false,
|
||||
loadingText: this.$lang('loadMoreHistory'),
|
||||
loadingText: this.$lang('common.list.load_more_history'),
|
||||
voiceInputing: false,
|
||||
audioContext: null,
|
||||
currentAudio: null,
|
||||
@@ -417,7 +417,7 @@ export default {
|
||||
localUserAvatar: '',
|
||||
showAvatarSelector: false, // 头像选择弹窗控制
|
||||
localUserNickname: '', // 当前用户昵称
|
||||
defaultNickname: this.$lang('defaultNickname'), // 默认昵称
|
||||
defaultNickname: this.$lang('common.list.default_nickname'), // 默认昵称
|
||||
showNicknameEditor: false, // 昵称编辑弹窗控制
|
||||
// AI头像错误状态
|
||||
avatarError: false,
|
||||
@@ -615,19 +615,19 @@ export default {
|
||||
console.log('[AI Chat] loadHistoryIfNeeded | localConvId:', localConvId, '| currentConvId:', this.currentConversationId, '| shouldReload:', shouldReload, '| messages.length:', this.messages.length, '| initialMessages.length:', this.initialMessages.length);
|
||||
|
||||
if (localConvId && shouldReload) {
|
||||
console.log('[AI Chat] → 分支1: ID变化,加载历史');
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l618.t0'));
|
||||
this.currentConversationId = localConvId;
|
||||
aiService.setConversationId(localConvId);
|
||||
this.loadChatHistoryIfExist();
|
||||
} else if (localConvId && !shouldReload && this.messages.length <= this.initialMessages.length) {
|
||||
console.log('[AI Chat] → 分支2: ID不变但只有初始消息,从服务端恢复');
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l623.t0'));
|
||||
this.currentConversationId = localConvId;
|
||||
this.loadChatHistoryIfExist();
|
||||
} else if (!localConvId && !this.currentConversationId) {
|
||||
console.log('[AI Chat] → 分支3: 全新会话');
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l627.t0'));
|
||||
this.historyOffset = this.messages.length;
|
||||
} else {
|
||||
console.log('[AI Chat] → 分支4: 跳过加载,保留当前消息, messages.length:', this.messages.length);
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l630.t0'), this.messages.length);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -635,7 +635,7 @@ export default {
|
||||
async _loadWelcomeMessage() {
|
||||
// 仅全新会话才需要欢迎语
|
||||
if (this.currentConversationId) {
|
||||
console.log('[AI Chat] 已有会话,跳过欢迎语')
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l638.t0'))
|
||||
return
|
||||
}
|
||||
|
||||
@@ -646,7 +646,7 @@ export default {
|
||||
// 1. 尝试从 API 获取远程欢迎语
|
||||
try {
|
||||
const config = await aiService.getServiceConfig()
|
||||
console.log('[AI Chat] API getServiceConfig 返回:', JSON.stringify(config))
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l649.t0'), JSON.stringify(config))
|
||||
if (config) {
|
||||
const welcomeInfo = config.welcome_info
|
||||
console.log('[AI Chat] welcomeInfo:', JSON.stringify(welcomeInfo))
|
||||
@@ -657,11 +657,11 @@ export default {
|
||||
welcomeText = remoteText
|
||||
isMarkdown = true
|
||||
welcomeLoaded = true
|
||||
console.log('[AI Chat] 使用远程欢迎语:', welcomeText.substring(0, 50))
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l660.t0'), welcomeText.substring(0, 50))
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[AI Chat] 获取服务配置失败:', e)
|
||||
console.warn($lang('ai_chat.ai-chat.ai-chat-message.l664.t0'), e)
|
||||
}
|
||||
|
||||
// 2. API 未返回有效欢迎语时,使用降级方案
|
||||
@@ -669,9 +669,9 @@ export default {
|
||||
welcomeText = this.fallbackWelcome
|
||||
isMarkdown = false
|
||||
if (welcomeText) {
|
||||
console.log('[AI Chat] 使用降级欢迎语')
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l672.t0'))
|
||||
} else {
|
||||
console.log('[AI Chat] 无可用欢迎语')
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l674.t0'))
|
||||
return
|
||||
}
|
||||
}
|
||||
@@ -764,21 +764,21 @@ export default {
|
||||
// 新增:加载历史记录
|
||||
async loadChatHistoryIfExist() {
|
||||
const convId = aiService.getConversationId();
|
||||
console.log('[AI Chat] loadChatHistoryIfExist 被调用, convId:', convId);
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l767.t0'), convId);
|
||||
if (convId) {
|
||||
try {
|
||||
// 调用正确的方法,并传入会话ID
|
||||
console.log('[AI Chat] 请求历史 API...');
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l771.t0'));
|
||||
const response = await aiService.getConversationHistory({
|
||||
conversation_id: convId
|
||||
});
|
||||
console.log('[AI Chat] 历史 API 返回:', JSON.stringify(response).substring(0, 200));
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l775.t0'), JSON.stringify(response).substring(0, 200));
|
||||
|
||||
if (!response.success || !Array.isArray(response.messages)) {
|
||||
console.warn('[AI Chat] 历史记录为空或格式无效, success:', response.success, 'messages:', Array.isArray(response.messages));
|
||||
console.warn($lang('ai_chat.ai-chat.ai-chat-message.l778.t0'), response.success, 'messages:', Array.isArray(response.messages));
|
||||
return;
|
||||
}
|
||||
console.log('[AI Chat] 原始消息数:', response.messages.length, 'total:', response.total);
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l781.t0'), response.messages.length, 'total:', response.total);
|
||||
// 需要根据实际返回的 response.data.messages 来映射
|
||||
this.messages = response.messages.map(msg => {
|
||||
let content = '';
|
||||
@@ -798,13 +798,13 @@ async loadChatHistoryIfExist() {
|
||||
actions: []
|
||||
};
|
||||
}).filter(msg => msg.content.trim() !== ''); // 过滤掉内容为空的消息
|
||||
console.log('[AI Chat] 过滤后消息数:', this.messages.length, '内容摘要:', this.messages.map(m => ({role: m.role, content: m.content.substring(0, 30)})));
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l801.t0'), this.messages.length, $lang('ai_chat.ai-chat.ai-chat-message.l801.t1'), this.messages.map(m => ({role: m.role, content: m.content.substring(0, 30)})));
|
||||
// 根据服务端 total 判断是否还有更多历史可加载
|
||||
const msgCount = this.messages.length;
|
||||
this.hasMoreHistory = response.total > msgCount;
|
||||
this.historyOffset = msgCount;
|
||||
} catch (error) {
|
||||
console.error('[AI Chat] 加载历史记录失败:', error.message, error.stack);
|
||||
console.error($lang('ai_chat.ai-chat.ai-chat-message.l807.t0'), error.message, error.stack);
|
||||
// 只需调用服务层的清除方法,它会处理本地存储
|
||||
aiService.clearConversationId();
|
||||
this.currentConversationId = null;
|
||||
@@ -857,7 +857,7 @@ async loadChatHistoryIfExist() {
|
||||
type: 'loading',
|
||||
content: '',
|
||||
timestamp: Date.now(),
|
||||
loadingText: this.$lang('aiThinking'),
|
||||
loadingText: this.$lang('ai_chat.list.ai_thinking'),
|
||||
_loadingIndex: 0
|
||||
}
|
||||
this.shouldScrollToBottom = true
|
||||
@@ -881,7 +881,7 @@ async loadChatHistoryIfExist() {
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('AI服务调用失败:', error)
|
||||
console.error($lang('ai_chat.ai-chat.ai-chat-message.l884.t0'), error)
|
||||
|
||||
// 移除加载状态
|
||||
this._removeLoadingMessages()
|
||||
@@ -891,10 +891,10 @@ async loadChatHistoryIfExist() {
|
||||
id: ++this.messageId,
|
||||
role: 'ai',
|
||||
type: 'text',
|
||||
content: this.$lang('serviceUnavailable'),
|
||||
content: this.$lang('chat.list.service_unavailable'),
|
||||
timestamp: Date.now(),
|
||||
actions: [
|
||||
{ id: 1, text: this.$lang('retry'), type: 'retry' }
|
||||
{ id: 1, text: this.$lang('common.button.retry'), type: 'retry' }
|
||||
]
|
||||
}
|
||||
this.shouldScrollToBottom = true
|
||||
@@ -975,7 +975,7 @@ async sendStreamMessage(userMessage) {
|
||||
this.isStreaming = true
|
||||
const loadingMsg = this.messages[loadingIdx]
|
||||
this._stopLoadingTextRotation(loadingMsg)
|
||||
loadingMsg.loadingText = this.$lang('receivingReply')
|
||||
loadingMsg.loadingText = this.$lang('common.list.receiving_reply')
|
||||
|
||||
let transformed = false
|
||||
|
||||
@@ -1023,7 +1023,7 @@ async sendStreamMessage(userMessage) {
|
||||
)
|
||||
// #endif
|
||||
} catch (error) {
|
||||
console.error('流式请求失败:', error)
|
||||
console.error($lang('ai_chat.ai-chat.ai-chat-message.l1026.t0'), error)
|
||||
this.isStreaming = false
|
||||
|
||||
if (!transformed) {
|
||||
@@ -1041,9 +1041,9 @@ async sendStreamMessage(userMessage) {
|
||||
id: ++this.messageId,
|
||||
role: 'ai',
|
||||
type: 'text',
|
||||
content: this.$lang('serviceTemporaryUnavailable'),
|
||||
content: this.$lang('chat.list.service_temporary_unavailable'),
|
||||
timestamp: Date.now(),
|
||||
actions: [{ id: 1, text: this.$lang('retry'), type: 'retry' }]
|
||||
actions: [{ id: 1, text: this.$lang('common.button.retry'), type: 'retry' }]
|
||||
}
|
||||
this.messages.push(errorMsg)
|
||||
this.$emit('ai-response', errorMsg)
|
||||
@@ -1079,7 +1079,7 @@ _finishStream(msg, result) {
|
||||
|
||||
// 流式请求出错处理
|
||||
_handleStreamError(msg) {
|
||||
console.error('流式请求失败')
|
||||
console.error($lang('ai_chat.ai-chat.ai-chat-message.l1082.t0'))
|
||||
this.isStreaming = false
|
||||
this.messages = this.messages.filter(m => m.id !== msg.id)
|
||||
|
||||
@@ -1087,9 +1087,9 @@ _handleStreamError(msg) {
|
||||
id: ++this.messageId,
|
||||
role: 'ai',
|
||||
type: 'text',
|
||||
content: this.$lang('serviceTemporaryUnavailable'),
|
||||
content: this.$lang('chat.list.service_temporary_unavailable'),
|
||||
timestamp: Date.now(),
|
||||
actions: [{ id: 1, text: this.$lang('retry'), type: 'retry' }]
|
||||
actions: [{ id: 1, text: this.$lang('common.button.retry'), type: 'retry' }]
|
||||
}
|
||||
this.messages.push(errorMsg)
|
||||
this.$emit('ai-response', errorMsg)
|
||||
@@ -1097,10 +1097,10 @@ _handleStreamError(msg) {
|
||||
// 加载状态文字轮换 - 让AI看起来在处理不同阶段
|
||||
_startLoadingTextRotation(loadingMsg) {
|
||||
const statusTexts = [
|
||||
'AI正在思考',
|
||||
'AI正在分析',
|
||||
'AI正在检索',
|
||||
'AI正在生成'
|
||||
$lang('ai_chat.ai-chat.ai-chat-message.l1100.t0'),
|
||||
$lang('ai_chat.ai-chat.ai-chat-message.l1101.t0'),
|
||||
$lang('ai_chat.ai-chat.ai-chat-message.l1102.t0'),
|
||||
$lang('ai_chat.ai-chat.ai-chat-message.l1103.t0')
|
||||
]
|
||||
loadingMsg._rotationTimer = setInterval(() => {
|
||||
loadingMsg._loadingIndex = (loadingMsg._loadingIndex + 1) % statusTexts.length
|
||||
@@ -1125,11 +1125,11 @@ _handleStreamError(msg) {
|
||||
|
||||
generateAIResponse(userMessage) {
|
||||
const responses = {
|
||||
'你好': '您好!我是AI智能客服,很高兴为您服务!有什么可以帮助您的吗?',
|
||||
'价格': '我们的产品价格根据型号和配置有所不同,具体价格请查看商品详情页面。',
|
||||
'发货': '一般情况下,订单会在24小时内发货,具体时效请查看物流信息。',
|
||||
'退货': '支持7天无理由退货,请确保商品完好无损。',
|
||||
'客服': '我们的客服工作时间是9:00-18:00,有问题可以随时联系我们。'
|
||||
'你好': $lang('ai_chat.ai-chat.ai-chat-message.l1128.t1'),
|
||||
'价格': $lang('ai_chat.ai-chat.ai-chat-message.l1129.t0'),
|
||||
'发货': $lang('ai_chat.ai-chat.ai-chat-message.l1130.t1'),
|
||||
'退货': $lang('ai_chat.ai-chat.ai-chat-message.l1131.t1'),
|
||||
'客服': $lang('ai_chat.ai-chat.ai-chat-message.l1132.t1')
|
||||
};
|
||||
for (let key in responses) {
|
||||
if (userMessage.includes(key)) {
|
||||
@@ -1365,10 +1365,10 @@ _handleStreamError(msg) {
|
||||
return timeStr;
|
||||
}
|
||||
if (msgDate.getTime() === yesterday.getTime()) {
|
||||
return `${this.$lang('timeFormatYesterday')} ${timeStr}`;
|
||||
return `${this.$lang('common.list.time_format_yesterday')} ${timeStr}`;
|
||||
}
|
||||
if (msgDate.getTime() === beforeYesterday.getTime()) {
|
||||
return `${this.$lang('timeFormatBeforeYesterday')} ${timeStr}`;
|
||||
return `${this.$lang('common.list.time_format_before_yesterday')} ${timeStr}`;
|
||||
}
|
||||
|
||||
const isCurrentYear = date.getFullYear() === now.getFullYear();
|
||||
@@ -1385,9 +1385,9 @@ _handleStreamError(msg) {
|
||||
|
||||
// 格式化文件大小
|
||||
formatFileSize(bytes) {
|
||||
if (!bytes) return this.$lang('about')
|
||||
if (!bytes) return this.$lang('common.list.about')
|
||||
const k = 1024
|
||||
const sizes = [this.$lang('about'), 'KB', 'MB', 'GB']
|
||||
const sizes = [this.$lang('common.list.about'), 'KB', 'MB', 'GB']
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k))
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + sizes[i]
|
||||
},
|
||||
@@ -1426,7 +1426,7 @@ _handleStreamError(msg) {
|
||||
}
|
||||
this.isFetchingHistory = true;
|
||||
this.isLoadingHistory = true;
|
||||
this.loadingText = '加载历史消息中...';
|
||||
this.loadingText = $lang('ai_chat.ai-chat.ai-chat-message.l1429.t0');
|
||||
|
||||
try {
|
||||
const response = await aiService.getConversationHistory({
|
||||
@@ -1474,13 +1474,13 @@ _handleStreamError(msg) {
|
||||
this.hasMoreHistory = false;
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('加载历史失败:', error);
|
||||
uni.showToast({ title: this.$lang('loadHistoryFail'), icon: 'none' });
|
||||
console.error($lang('ai_chat.ai-chat.ai-chat-message.l1477.t0'), error);
|
||||
uni.showToast({ title: this.$lang('common.list.load_history_fail'), icon: 'none' });
|
||||
this.hasMoreHistory = false;
|
||||
} finally {
|
||||
this.isLoadingHistory = false;
|
||||
this.isFetchingHistory = false;
|
||||
this.loadingText = '加载更多历史消息';
|
||||
this.loadingText = $lang('ai_chat.ai-chat.ai-chat-message.l1483.t0');
|
||||
}
|
||||
},
|
||||
// 显示更多工具
|
||||
@@ -1490,7 +1490,7 @@ _handleStreamError(msg) {
|
||||
|
||||
// 预览文件
|
||||
previewFile(message) {
|
||||
uni.showLoading({ title: this.$lang('openingFile') })
|
||||
uni.showLoading({ title: this.$lang('common.list.opening_file') })
|
||||
|
||||
// #ifdef H5
|
||||
window.open(message.url, '_blank')
|
||||
@@ -1500,7 +1500,7 @@ _handleStreamError(msg) {
|
||||
plus.runtime.openFile(message.url, {
|
||||
error: (e) => {
|
||||
uni.showToast({
|
||||
title: this.$lang('fileOpenFail'),
|
||||
title: this.$lang('common.list.file_open_fail'),
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -1674,7 +1674,7 @@ _handleStreamError(msg) {
|
||||
copyText = message.content || ''
|
||||
}
|
||||
if (!copyText) {
|
||||
uni.showToast({ title: this.$lang('noContentToCopy'), icon: 'none' })
|
||||
uni.showToast({ title: this.$lang('common.list.no_content_to_copy'), icon: 'none' })
|
||||
return
|
||||
}
|
||||
|
||||
@@ -1688,7 +1688,7 @@ _handleStreamError(msg) {
|
||||
try {
|
||||
if (navigator.clipboard && navigator.clipboard.writeText) {
|
||||
navigator.clipboard.writeText(finalText).then(() => {
|
||||
uni.showToast({ title: selectedText ? '已复制选中内容' : '已复制', icon: 'success' })
|
||||
uni.showToast({ title: selectedText ? '已复制选中内容' : $lang('ai_chat.ai-chat.ai-chat-message.l1691.t1'), icon: 'success' })
|
||||
}).catch(() => {
|
||||
this._fallbackCopyH5(finalText)
|
||||
})
|
||||
@@ -1702,17 +1702,17 @@ _handleStreamError(msg) {
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
// 微信小程序专用(含小米等 Android 兼容)
|
||||
console.log('[AI Chat] 开始复制, 内容长度:', copyText.length, '内容前50字:', copyText.substring(0, 50))
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l1705.t0'), copyText.length, $lang('ai_chat.ai-chat.ai-chat-message.l1705.t1'), copyText.substring(0, 50))
|
||||
uni.setClipboardData({
|
||||
data: copyText,
|
||||
success: () => {
|
||||
console.log('[AI Chat] 复制成功')
|
||||
uni.showToast({ title: this.$lang('copySuccess'), icon: 'success' })
|
||||
console.log($lang('ai_chat.ai-chat.ai-chat-message.l1709.t0'))
|
||||
uni.showToast({ title: this.$lang('common.tip.copySuccess'), icon: 'success' })
|
||||
},
|
||||
fail: (err) => {
|
||||
console.error('[AI Chat] 复制失败, 详细错误:', JSON.stringify(err))
|
||||
console.error('[AI Chat] 复制失败 errMsg:', err.errMsg || err.message || '无错误消息')
|
||||
uni.showToast({ title: this.$lang('copyFail') + ': ' + (err.errMsg || this.$lang('serviceUnavailable')), icon: 'none', duration: 3000 })
|
||||
console.error($lang('ai_chat.ai-chat.ai-chat-message.l1713.t0'), JSON.stringify(err))
|
||||
console.error($lang('ai_chat.ai-chat.ai-chat-message.l1714.t0'), err.errMsg || err.message || $lang('ai_chat.ai-chat.ai-chat-message.l1714.t1'))
|
||||
uni.showToast({ title: this.$lang('common.tip.copyFail') + ': ' + (err.errMsg || this.$lang('chat.list.service_unavailable')), icon: 'none', duration: 3000 })
|
||||
}
|
||||
})
|
||||
// #endif
|
||||
@@ -1733,12 +1733,12 @@ _handleStreamError(msg) {
|
||||
const success = document.execCommand('copy')
|
||||
document.body.removeChild(textarea)
|
||||
if (success) {
|
||||
uni.showToast({ title: this.$lang('copySuccess'), icon: 'success' })
|
||||
uni.showToast({ title: this.$lang('common.tip.copySuccess'), icon: 'success' })
|
||||
} else {
|
||||
uni.showToast({ title: this.$lang('copyFail'), icon: 'none' })
|
||||
uni.showToast({ title: this.$lang('common.tip.copyFail'), icon: 'none' })
|
||||
}
|
||||
} catch (e) {
|
||||
uni.showToast({ title: this.$lang('copyFail'), icon: 'none' })
|
||||
uni.showToast({ title: this.$lang('common.tip.copyFail'), icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1841,7 +1841,7 @@ _handleStreamError(msg) {
|
||||
type: 'loading',
|
||||
content: '',
|
||||
timestamp: Date.now(),
|
||||
loadingText: this.$lang('aiThinking'),
|
||||
loadingText: this.$lang('ai_chat.list.ai_thinking'),
|
||||
_loadingIndex: 0
|
||||
}
|
||||
|
||||
@@ -1862,7 +1862,7 @@ _handleStreamError(msg) {
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
console.error('AI服务调用失败:', error)
|
||||
console.error($lang('ai_chat.ai-chat.ai-chat-message.l884.t0'), error)
|
||||
|
||||
// 移除加载状态
|
||||
this._removeLoadingMessages()
|
||||
@@ -1872,10 +1872,10 @@ _handleStreamError(msg) {
|
||||
id: ++this.messageId,
|
||||
role: 'ai',
|
||||
type: 'text',
|
||||
content: this.$lang('serviceUnavailable'),
|
||||
content: this.$lang('chat.list.service_unavailable'),
|
||||
timestamp: Date.now(),
|
||||
actions: [
|
||||
{ id: 1, text: this.$lang('retry'), type: 'retry' }
|
||||
{ id: 1, text: this.$lang('common.button.retry'), type: 'retry' }
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1968,167 +1968,167 @@ _handleStreamError(msg) {
|
||||
enhanceEmojiMessage(content) {
|
||||
// 常见表情的含义映射
|
||||
const emojiResponses = {
|
||||
'😀': '[开心]',
|
||||
'😂': '[大笑]',
|
||||
'😊': '[微笑]',
|
||||
'❤️': '[爱心]',
|
||||
'👍': '[点赞]',
|
||||
'😭': '[哭泣]',
|
||||
'🙏': '[感谢/拜托]',
|
||||
'😍': '[喜欢]',
|
||||
'🎉': '[庆祝]',
|
||||
'🤔': '[思考]',
|
||||
'😅': '[尴尬]',
|
||||
'😁': '[开心]',
|
||||
'🥰': '[喜爱]',
|
||||
'😘': '[飞吻]',
|
||||
'😏': '[坏笑]',
|
||||
'🥳': '[庆祝]',
|
||||
'😔': '[难过]',
|
||||
'😢': '[哭泣]',
|
||||
'😤': '[生气]',
|
||||
'😴': '[困]',
|
||||
'🤗': '[拥抱]',
|
||||
'🙂': '[微笑]',
|
||||
'😃': '[开心]',
|
||||
'😄': '[大笑]',
|
||||
'😆': '[开心]',
|
||||
'😇': '[天使]',
|
||||
'🤩': '[惊喜]',
|
||||
'😋': '[好吃]',
|
||||
'😛': '[调皮]',
|
||||
'😜': '[调皮]',
|
||||
'🤪': '[搞怪]',
|
||||
'😝': '[开心]',
|
||||
'🤑': '[发财]',
|
||||
'🤭': '[害羞]',
|
||||
'🤫': '[嘘]',
|
||||
'🤐': '[闭嘴]',
|
||||
'🤨': '[疑惑]',
|
||||
'😐': '[无语]',
|
||||
'😑': '[无语]',
|
||||
'😶': '[沉默]',
|
||||
'😒': '[不屑]',
|
||||
'🙄': '[白眼]',
|
||||
'😬': '[尴尬]',
|
||||
'🤥': '[说谎]',
|
||||
'😌': '[安心]',
|
||||
'😪': '[困]',
|
||||
'🤤': '[流口水]',
|
||||
'😷': '[生病]',
|
||||
'🤒': '[发烧]',
|
||||
'🤕': '[受伤]',
|
||||
'🤢': '[恶心]',
|
||||
'🤮': '[呕吐]',
|
||||
'🤧': '[感冒]',
|
||||
'🥵': '[热]',
|
||||
'🥶': '[冷]',
|
||||
'🥴': '[头晕]',
|
||||
'😵': '[晕]',
|
||||
'🤯': '[爆炸]',
|
||||
'🤠': '[酷]',
|
||||
'😎': '[酷]',
|
||||
'🤓': '[书呆子]',
|
||||
'🧐': '[疑惑]',
|
||||
'😕': '[困惑]',
|
||||
'😟': '[担心]',
|
||||
'🙁': '[难过]',
|
||||
'😮': '[惊讶]',
|
||||
'😯': '[惊讶]',
|
||||
'😲': '[震惊]',
|
||||
'😳': '[脸红]',
|
||||
'🥺': '[恳求]',
|
||||
'😦': '[惊讶]',
|
||||
'😧': '[惊讶]',
|
||||
'😨': '[害怕]',
|
||||
'😰': '[紧张]',
|
||||
'😥': '[失望]',
|
||||
'😱': '[恐惧]',
|
||||
'😖': '[困扰]',
|
||||
'😣': '[痛苦]',
|
||||
'😞': '[难过]',
|
||||
'😓': '[汗]',
|
||||
'😩': '[累]',
|
||||
'😫': '[累]',
|
||||
'🥱': '[困]',
|
||||
'😡': '[愤怒]',
|
||||
'😠': '[生气]',
|
||||
'🤬': '[咒骂]',
|
||||
'😈': '[恶魔]',
|
||||
'👿': '[生气]',
|
||||
'💀': '[骷髅]',
|
||||
'💩': '[便便]',
|
||||
'👻': '[鬼]',
|
||||
'👽': '[外星人]',
|
||||
'🤖': '[机器人]',
|
||||
'🎃': '[万圣节]',
|
||||
'😺': '[开心猫]',
|
||||
'😸': '[微笑猫]',
|
||||
'😹': '[大笑猫]',
|
||||
'😻': '[花痴猫]',
|
||||
'😼': '[得意猫]',
|
||||
'😽': '[亲亲猫]',
|
||||
'🙀': '[惊讶猫]',
|
||||
'😿': '[哭泣猫]',
|
||||
'😾': '[生气猫]',
|
||||
'👋': '[挥手]',
|
||||
'🤚': '[举手]',
|
||||
'🖐': '[手掌]',
|
||||
'✋': '[手掌]',
|
||||
'😀': $lang('ai_chat.ai-chat.ai-chat-message.l1971.t0'),
|
||||
'😂': $lang('ai_chat.ai-chat.ai-chat-message.l1972.t0'),
|
||||
'😊': $lang('ai_chat.ai-chat.ai-chat-message.l1973.t0'),
|
||||
'❤️': $lang('ai_chat.ai-chat.ai-chat-message.l1974.t0'),
|
||||
'👍': $lang('ai_chat.ai-chat.ai-chat-message.l1975.t0'),
|
||||
'😭': $lang('ai_chat.ai-chat.ai-chat-message.l1976.t0'),
|
||||
'🙏': $lang('ai_chat.ai-chat.ai-chat-message.l1977.t0'),
|
||||
'😍': $lang('ai_chat.ai-chat.ai-chat-message.l1978.t0'),
|
||||
'🎉': $lang('ai_chat.ai-chat.ai-chat-message.l1979.t0'),
|
||||
'🤔': $lang('ai_chat.ai-chat.ai-chat-message.l1980.t0'),
|
||||
'😅': $lang('ai_chat.ai-chat.ai-chat-message.l1981.t0'),
|
||||
'😁': $lang('ai_chat.ai-chat.ai-chat-message.l1971.t0'),
|
||||
'🥰': $lang('ai_chat.ai-chat.ai-chat-message.l1983.t0'),
|
||||
'😘': $lang('ai_chat.ai-chat.ai-chat-message.l1984.t0'),
|
||||
'😏': $lang('ai_chat.ai-chat.ai-chat-message.l1985.t0'),
|
||||
'🥳': $lang('ai_chat.ai-chat.ai-chat-message.l1979.t0'),
|
||||
'😔': $lang('ai_chat.ai-chat.ai-chat-message.l1987.t0'),
|
||||
'😢': $lang('ai_chat.ai-chat.ai-chat-message.l1976.t0'),
|
||||
'😤': $lang('ai_chat.ai-chat.ai-chat-message.l1989.t0'),
|
||||
'😴': $lang('ai_chat.ai-chat.ai-chat-message.l1990.t0'),
|
||||
'🤗': $lang('ai_chat.ai-chat.ai-chat-message.l1991.t0'),
|
||||
'🙂': $lang('ai_chat.ai-chat.ai-chat-message.l1973.t0'),
|
||||
'😃': $lang('ai_chat.ai-chat.ai-chat-message.l1971.t0'),
|
||||
'😄': $lang('ai_chat.ai-chat.ai-chat-message.l1972.t0'),
|
||||
'😆': $lang('ai_chat.ai-chat.ai-chat-message.l1971.t0'),
|
||||
'😇': $lang('ai_chat.ai-chat.ai-chat-message.l1996.t0'),
|
||||
'🤩': $lang('ai_chat.ai-chat.ai-chat-message.l1997.t0'),
|
||||
'😋': $lang('ai_chat.ai-chat.ai-chat-message.l1998.t0'),
|
||||
'😛': $lang('ai_chat.ai-chat.ai-chat-message.l1999.t0'),
|
||||
'😜': $lang('ai_chat.ai-chat.ai-chat-message.l1999.t0'),
|
||||
'🤪': $lang('ai_chat.ai-chat.ai-chat-message.l2001.t0'),
|
||||
'😝': $lang('ai_chat.ai-chat.ai-chat-message.l1971.t0'),
|
||||
'🤑': $lang('ai_chat.ai-chat.ai-chat-message.l2003.t0'),
|
||||
'🤭': $lang('ai_chat.ai-chat.ai-chat-message.l2004.t0'),
|
||||
'🤫': $lang('ai_chat.ai-chat.ai-chat-message.l2005.t0'),
|
||||
'🤐': $lang('ai_chat.ai-chat.ai-chat-message.l2006.t0'),
|
||||
'🤨': $lang('ai_chat.ai-chat.ai-chat-message.l2007.t0'),
|
||||
'😐': $lang('ai_chat.ai-chat.ai-chat-message.l2008.t0'),
|
||||
'😑': $lang('ai_chat.ai-chat.ai-chat-message.l2008.t0'),
|
||||
'😶': $lang('ai_chat.ai-chat.ai-chat-message.l2010.t0'),
|
||||
'😒': $lang('ai_chat.ai-chat.ai-chat-message.l2011.t0'),
|
||||
'🙄': $lang('ai_chat.ai-chat.ai-chat-message.l2012.t0'),
|
||||
'😬': $lang('ai_chat.ai-chat.ai-chat-message.l1981.t0'),
|
||||
'🤥': $lang('ai_chat.ai-chat.ai-chat-message.l2014.t0'),
|
||||
'😌': $lang('ai_chat.ai-chat.ai-chat-message.l2015.t0'),
|
||||
'😪': $lang('ai_chat.ai-chat.ai-chat-message.l1990.t0'),
|
||||
'🤤': $lang('ai_chat.ai-chat.ai-chat-message.l2017.t0'),
|
||||
'😷': $lang('ai_chat.ai-chat.ai-chat-message.l2018.t0'),
|
||||
'🤒': $lang('ai_chat.ai-chat.ai-chat-message.l2019.t0'),
|
||||
'🤕': $lang('ai_chat.ai-chat.ai-chat-message.l2020.t0'),
|
||||
'🤢': $lang('ai_chat.ai-chat.ai-chat-message.l2021.t0'),
|
||||
'🤮': $lang('ai_chat.ai-chat.ai-chat-message.l2022.t0'),
|
||||
'🤧': $lang('ai_chat.ai-chat.ai-chat-message.l2023.t0'),
|
||||
'🥵': $lang('ai_chat.ai-chat.ai-chat-message.l2024.t0'),
|
||||
'🥶': $lang('ai_chat.ai-chat.ai-chat-message.l2025.t0'),
|
||||
'🥴': $lang('ai_chat.ai-chat.ai-chat-message.l2026.t0'),
|
||||
'😵': $lang('ai_chat.ai-chat.ai-chat-message.l2027.t0'),
|
||||
'🤯': $lang('ai_chat.ai-chat.ai-chat-message.l2028.t0'),
|
||||
'🤠': $lang('ai_chat.ai-chat.ai-chat-message.l2029.t0'),
|
||||
'😎': $lang('ai_chat.ai-chat.ai-chat-message.l2029.t0'),
|
||||
'🤓': $lang('ai_chat.ai-chat.ai-chat-message.l2031.t0'),
|
||||
'🧐': $lang('ai_chat.ai-chat.ai-chat-message.l2007.t0'),
|
||||
'😕': $lang('ai_chat.ai-chat.ai-chat-message.l2033.t0'),
|
||||
'😟': $lang('ai_chat.ai-chat.ai-chat-message.l2034.t0'),
|
||||
'🙁': $lang('ai_chat.ai-chat.ai-chat-message.l1987.t0'),
|
||||
'😮': $lang('ai_chat.ai-chat.ai-chat-message.l2036.t0'),
|
||||
'😯': $lang('ai_chat.ai-chat.ai-chat-message.l2036.t0'),
|
||||
'😲': $lang('ai_chat.ai-chat.ai-chat-message.l2038.t0'),
|
||||
'😳': $lang('ai_chat.ai-chat.ai-chat-message.l2039.t0'),
|
||||
'🥺': $lang('ai_chat.ai-chat.ai-chat-message.l2040.t0'),
|
||||
'😦': $lang('ai_chat.ai-chat.ai-chat-message.l2036.t0'),
|
||||
'😧': $lang('ai_chat.ai-chat.ai-chat-message.l2036.t0'),
|
||||
'😨': $lang('ai_chat.ai-chat.ai-chat-message.l2043.t0'),
|
||||
'😰': $lang('ai_chat.ai-chat.ai-chat-message.l2044.t0'),
|
||||
'😥': $lang('ai_chat.ai-chat.ai-chat-message.l2045.t0'),
|
||||
'😱': $lang('ai_chat.ai-chat.ai-chat-message.l2046.t0'),
|
||||
'😖': $lang('ai_chat.ai-chat.ai-chat-message.l2047.t0'),
|
||||
'😣': $lang('ai_chat.ai-chat.ai-chat-message.l2048.t0'),
|
||||
'😞': $lang('ai_chat.ai-chat.ai-chat-message.l1987.t0'),
|
||||
'😓': $lang('ai_chat.ai-chat.ai-chat-message.l2050.t0'),
|
||||
'😩': $lang('ai_chat.ai-chat.ai-chat-message.l2051.t0'),
|
||||
'😫': $lang('ai_chat.ai-chat.ai-chat-message.l2051.t0'),
|
||||
'🥱': $lang('ai_chat.ai-chat.ai-chat-message.l1990.t0'),
|
||||
'😡': $lang('ai_chat.ai-chat.ai-chat-message.l2054.t0'),
|
||||
'😠': $lang('ai_chat.ai-chat.ai-chat-message.l1989.t0'),
|
||||
'🤬': $lang('ai_chat.ai-chat.ai-chat-message.l2056.t0'),
|
||||
'😈': $lang('ai_chat.ai-chat.ai-chat-message.l2057.t0'),
|
||||
'👿': $lang('ai_chat.ai-chat.ai-chat-message.l1989.t0'),
|
||||
'💀': $lang('ai_chat.ai-chat.ai-chat-message.l2059.t0'),
|
||||
'💩': $lang('ai_chat.ai-chat.ai-chat-message.l2060.t0'),
|
||||
'👻': $lang('ai_chat.ai-chat.ai-chat-message.l2061.t0'),
|
||||
'👽': $lang('ai_chat.ai-chat.ai-chat-message.l2062.t0'),
|
||||
'🤖': $lang('ai_chat.ai-chat.ai-chat-message.l2063.t0'),
|
||||
'🎃': $lang('ai_chat.ai-chat.ai-chat-message.l2064.t0'),
|
||||
'😺': $lang('ai_chat.ai-chat.ai-chat-message.l2065.t0'),
|
||||
'😸': $lang('ai_chat.ai-chat.ai-chat-message.l2066.t0'),
|
||||
'😹': $lang('ai_chat.ai-chat.ai-chat-message.l2067.t0'),
|
||||
'😻': $lang('ai_chat.ai-chat.ai-chat-message.l2068.t0'),
|
||||
'😼': $lang('ai_chat.ai-chat.ai-chat-message.l2069.t0'),
|
||||
'😽': $lang('ai_chat.ai-chat.ai-chat-message.l2070.t0'),
|
||||
'🙀': $lang('ai_chat.ai-chat.ai-chat-message.l2071.t0'),
|
||||
'😿': $lang('ai_chat.ai-chat.ai-chat-message.l2072.t0'),
|
||||
'😾': $lang('ai_chat.ai-chat.ai-chat-message.l2073.t0'),
|
||||
'👋': $lang('ai_chat.ai-chat.ai-chat-message.l2074.t0'),
|
||||
'🤚': $lang('ai_chat.ai-chat.ai-chat-message.l2075.t0'),
|
||||
'🖐': $lang('ai_chat.ai-chat.ai-chat-message.l2076.t0'),
|
||||
'✋': $lang('ai_chat.ai-chat.ai-chat-message.l2076.t0'),
|
||||
'🖖': '[V]',
|
||||
'👌': '[OK]',
|
||||
'🤏': '[捏]',
|
||||
'✌️': '[耶]',
|
||||
'🤞': '[好运]',
|
||||
'🤟': '[爱你]',
|
||||
'🤘': '[摇滚]',
|
||||
'🤙': '[打电话]',
|
||||
'👈': '[左边]',
|
||||
'👉': '[右边]',
|
||||
'👆': '[上边]',
|
||||
'🖕': '[竖中指]',
|
||||
'👇': '[下边]',
|
||||
'☝': '[向上]',
|
||||
'👎': '[鄙视]',
|
||||
'✊': '[拳头]',
|
||||
'👊': '[拳头]',
|
||||
'🤛': '[左拳]',
|
||||
'🤜': '[右拳]',
|
||||
'👏': '[鼓掌]',
|
||||
'🙌': '[举手庆祝]',
|
||||
'👐': '[张开手]',
|
||||
'🤲': '[摊手]',
|
||||
'🤝': '[握手]',
|
||||
'✍️': '[写字]',
|
||||
'💅': '[美甲]',
|
||||
'🤳': '[自拍]',
|
||||
'💪': '[肌肉]',
|
||||
'💗': '[爱心]',
|
||||
'💓': '[心跳]',
|
||||
'💕': '[两颗心]',
|
||||
'💖': '[闪亮心]',
|
||||
'💝': '[礼物心]',
|
||||
'💞': '[旋转心]',
|
||||
'💘': '[丘比特]',
|
||||
'💌': '[情书]',
|
||||
'💟': '[心形]',
|
||||
'💛': '[黄心]',
|
||||
'💙': '[蓝心]',
|
||||
'💜': '[紫心]',
|
||||
'🖤': '[黑心]',
|
||||
'💔': '[心碎]',
|
||||
'💢': '[愤怒]',
|
||||
'💣': '[炸弹]',
|
||||
'💥': '[爆炸]',
|
||||
'💫': '[头晕]',
|
||||
'💦': '[汗]',
|
||||
'💨': '[风]',
|
||||
'👁️': '[眼睛]',
|
||||
'👀': '[看]',
|
||||
'👅': '[舌头]',
|
||||
'👄': '[嘴巴]',
|
||||
'👂': '[耳朵]',
|
||||
'👃': '[鼻子]'
|
||||
'🤏': $lang('ai_chat.ai-chat.ai-chat-message.l2080.t0'),
|
||||
'✌️': $lang('ai_chat.ai-chat.ai-chat-message.l2081.t0'),
|
||||
'🤞': $lang('ai_chat.ai-chat.ai-chat-message.l2082.t0'),
|
||||
'🤟': $lang('ai_chat.ai-chat.ai-chat-message.l2083.t0'),
|
||||
'🤘': $lang('ai_chat.ai-chat.ai-chat-message.l2084.t0'),
|
||||
'🤙': $lang('ai_chat.ai-chat.ai-chat-message.l2085.t0'),
|
||||
'👈': $lang('ai_chat.ai-chat.ai-chat-message.l2086.t0'),
|
||||
'👉': $lang('ai_chat.ai-chat.ai-chat-message.l2087.t0'),
|
||||
'👆': $lang('ai_chat.ai-chat.ai-chat-message.l2088.t0'),
|
||||
'🖕': $lang('ai_chat.ai-chat.ai-chat-message.l2089.t0'),
|
||||
'👇': $lang('ai_chat.ai-chat.ai-chat-message.l2090.t0'),
|
||||
'☝': $lang('ai_chat.ai-chat.ai-chat-message.l2091.t0'),
|
||||
'👎': $lang('ai_chat.ai-chat.ai-chat-message.l2092.t0'),
|
||||
'✊': $lang('ai_chat.ai-chat.ai-chat-message.l2093.t0'),
|
||||
'👊': $lang('ai_chat.ai-chat.ai-chat-message.l2093.t0'),
|
||||
'🤛': $lang('ai_chat.ai-chat.ai-chat-message.l2095.t0'),
|
||||
'🤜': $lang('ai_chat.ai-chat.ai-chat-message.l2096.t0'),
|
||||
'👏': $lang('ai_chat.ai-chat.ai-chat-message.l2097.t0'),
|
||||
'🙌': $lang('ai_chat.ai-chat.ai-chat-message.l2098.t0'),
|
||||
'👐': $lang('ai_chat.ai-chat.ai-chat-message.l2099.t0'),
|
||||
'🤲': $lang('ai_chat.ai-chat.ai-chat-message.l2100.t0'),
|
||||
'🤝': $lang('ai_chat.ai-chat.ai-chat-message.l2101.t0'),
|
||||
'✍️': $lang('ai_chat.ai-chat.ai-chat-message.l2102.t0'),
|
||||
'💅': $lang('ai_chat.ai-chat.ai-chat-message.l2103.t0'),
|
||||
'🤳': $lang('ai_chat.ai-chat.ai-chat-message.l2104.t0'),
|
||||
'💪': $lang('ai_chat.ai-chat.ai-chat-message.l2105.t0'),
|
||||
'💗': $lang('ai_chat.ai-chat.ai-chat-message.l1974.t0'),
|
||||
'💓': $lang('ai_chat.ai-chat.ai-chat-message.l2107.t0'),
|
||||
'💕': $lang('ai_chat.ai-chat.ai-chat-message.l2108.t0'),
|
||||
'💖': $lang('ai_chat.ai-chat.ai-chat-message.l2109.t0'),
|
||||
'💝': $lang('ai_chat.ai-chat.ai-chat-message.l2110.t0'),
|
||||
'💞': $lang('ai_chat.ai-chat.ai-chat-message.l2111.t0'),
|
||||
'💘': $lang('ai_chat.ai-chat.ai-chat-message.l2112.t0'),
|
||||
'💌': $lang('ai_chat.ai-chat.ai-chat-message.l2113.t0'),
|
||||
'💟': $lang('ai_chat.ai-chat.ai-chat-message.l2114.t0'),
|
||||
'💛': $lang('ai_chat.ai-chat.ai-chat-message.l2115.t0'),
|
||||
'💙': $lang('ai_chat.ai-chat.ai-chat-message.l2116.t0'),
|
||||
'💜': $lang('ai_chat.ai-chat.ai-chat-message.l2117.t0'),
|
||||
'🖤': $lang('ai_chat.ai-chat.ai-chat-message.l2118.t0'),
|
||||
'💔': $lang('ai_chat.ai-chat.ai-chat-message.l2119.t0'),
|
||||
'💢': $lang('ai_chat.ai-chat.ai-chat-message.l2054.t0'),
|
||||
'💣': $lang('ai_chat.ai-chat.ai-chat-message.l2121.t0'),
|
||||
'💥': $lang('ai_chat.ai-chat.ai-chat-message.l2028.t0'),
|
||||
'💫': $lang('ai_chat.ai-chat.ai-chat-message.l2026.t0'),
|
||||
'💦': $lang('ai_chat.ai-chat.ai-chat-message.l2050.t0'),
|
||||
'💨': $lang('ai_chat.ai-chat.ai-chat-message.l2125.t0'),
|
||||
'👁️': $lang('ai_chat.ai-chat.ai-chat-message.l2126.t0'),
|
||||
'👀': $lang('ai_chat.ai-chat.ai-chat-message.l2127.t0'),
|
||||
'👅': $lang('ai_chat.ai-chat.ai-chat-message.l2128.t0'),
|
||||
'👄': $lang('ai_chat.ai-chat.ai-chat-message.l2129.t0'),
|
||||
'👂': $lang('ai_chat.ai-chat.ai-chat-message.l2130.t0'),
|
||||
'👃': $lang('ai_chat.ai-chat.ai-chat-message.l2131.t0')
|
||||
}
|
||||
|
||||
// 如果是纯表情消息,添加一些提示
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="avatar-selector-mask" @click="close"></view>
|
||||
<view class="avatar-selector-panel">
|
||||
<view class="avatar-selector-header">
|
||||
<text>{{ $lang('avatarSelectorTitle') }}</text>
|
||||
<text>{{ $lang('common.list.avatar_selector_title') }}</text>
|
||||
<button class="close-btn" @click="close">
|
||||
<text class="iconfont icon-close"></text>
|
||||
</button>
|
||||
@@ -15,10 +15,10 @@
|
||||
<view class="avatar-selector-actions">
|
||||
<button class="avatar-select-action" @click="chooseAvatarFromAlbum">
|
||||
<text class="iconfont icon-album"></text>
|
||||
<text>{{ $lang('chooseFromAlbum') }}</text>
|
||||
<text>{{ $lang('common.list.choose_from_album') }}</text>
|
||||
</button>
|
||||
<button class="avatar-select-action cancel" @click="close">
|
||||
<text>{{ $lang('cancel') }}</text>
|
||||
<text>{{ $lang('common.button.cancel') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="emoji-mask" @click="hideEmojiPanel"></view>
|
||||
<view class="emoji-panel">
|
||||
<view class="emoji-header">
|
||||
<text>{{ $lang('emojiTitle') }}</text>
|
||||
<text>{{ $lang('common.list.emoji_title') }}</text>
|
||||
<button class="close-btn" @click="hideEmojiPanel">
|
||||
<text>×</text>
|
||||
</button>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="nickname-editor-mask" @click="close"></view>
|
||||
<view class="nickname-editor-panel">
|
||||
<view class="nickname-editor-header">
|
||||
<text>{{ $lang('editNickname') }}</text>
|
||||
<text>{{ $lang('common.list.edit_nickname') }}</text>
|
||||
<button class="close-btn" @click="close">
|
||||
<text class="iconfont icon-close"></text>
|
||||
</button>
|
||||
@@ -13,21 +13,21 @@
|
||||
<input
|
||||
v-model="tempNickname"
|
||||
class="nickname-input"
|
||||
:placeholder="$lang('newNicknamePlaceholder')"
|
||||
:placeholder="$lang('common.list.new_nickname_placeholder')"
|
||||
:maxlength="12"
|
||||
type="text" />
|
||||
</view>
|
||||
<view class="nickname-tip">{{ $lang('nicknameTip') }}</view>
|
||||
<view class="nickname-tip">{{ $lang('common.list.nickname_tip') }}</view>
|
||||
<view class="nickname-editor-actions">
|
||||
<button class="nickname-action-btn cancel" @click="close">
|
||||
<text>{{ $lang('cancel') }}</text>
|
||||
<text>{{ $lang('common.button.cancel') }}</text>
|
||||
</button>
|
||||
<button
|
||||
class="nickname-action-btn confirm"
|
||||
:class="{ disabled: !tempNickname.trim() }"
|
||||
:disabled="!tempNickname.trim()"
|
||||
@click="saveNickname">
|
||||
<text>{{ $lang('save') }}</text>
|
||||
<text>{{ $lang('common.button.save') }}</text>
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -87,7 +87,7 @@ export default {
|
||||
uni.setStorageSync('user_nickname', newNickname)
|
||||
this.$emit('nickname-change', newNickname)
|
||||
this.close()
|
||||
uni.showToast({ title: this.$lang('nicknameChangeSuccess'), icon: 'success', duration: 1500 })
|
||||
uni.showToast({ title: this.$lang('common.list.nickname_change_success'), icon: 'success', duration: 1500 })
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<!-- 搜索入口按钮(浮动在消息区右上角) -->
|
||||
<view class="search-entrance" :class="{ 'icon-only': !showLabel }" v-if="!showSearchBar" @click="toggleSearch">
|
||||
<text class="iconfont icon-sousuo search-entrance-icon"></text>
|
||||
<text class="search-entrance-label" v-if="showLabel">{{ $lang('searchEntrance') }}</text>
|
||||
<text class="search-entrance-label" v-if="showLabel">{{ $lang('common.placeholder.search') }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 搜索浮条 -->
|
||||
@@ -14,7 +14,7 @@
|
||||
<input
|
||||
class="search-bar-input"
|
||||
v-model="searchKeyword"
|
||||
:placeholder="$lang('searchPlaceholder')"
|
||||
:placeholder="$lang('common.placeholder.search')"
|
||||
:focus="true"
|
||||
@input="onSearchInput"
|
||||
@confirm="doSearch" />
|
||||
@@ -27,11 +27,11 @@
|
||||
<text class="search-bar-nav" :class="{ disabled: searchResultIndex >= searchResults.length - 1 }" @click="scrollToNextResult">▼</text>
|
||||
</view>
|
||||
</view>
|
||||
<text class="search-bar-close" @click="closeSearch">{{ $lang('searchClose') }}</text>
|
||||
<text class="search-bar-close" @click="closeSearch">{{ $lang('goods.list.search_close') }}</text>
|
||||
</view>
|
||||
<view class="search-bar-status" v-if="searched && searchKeyword && searchResults.length === 0">
|
||||
<text class="search-bar-status-icon">!</text>
|
||||
<text class="search-bar-status-text">{{ $lang('noMatchResult') }}</text>
|
||||
<text class="search-bar-status-text">{{ $lang('common.list.no_match_result') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -43,7 +43,7 @@
|
||||
*
|
||||
* Props:
|
||||
* messages: Array - 原始消息列表
|
||||
* showLabel: Boolean - (默认 true) 是否显示"搜索"文字;设为 false 则只显示搜索图标
|
||||
* showLabel: Boolean - (默认 true) 是否显示$lang("diy.diy-search.l31.t0")文字;设为 false 则只显示搜索图标
|
||||
*
|
||||
* Events:
|
||||
* scroll-to: (messageKey: string) => void - 请求父组件滚动到指定消息
|
||||
@@ -187,7 +187,7 @@ export default {
|
||||
if (idx >= 0) {
|
||||
this.scrollToSearchResult(idx)
|
||||
} else {
|
||||
uni.showToast({ title: this.$lang('searchAtTop'), icon: 'none' })
|
||||
uni.showToast({ title: this.$lang('goods.list.search_at_top'), icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
||||
@@ -196,7 +196,7 @@ export default {
|
||||
if (idx < this.searchResults.length) {
|
||||
this.scrollToSearchResult(idx)
|
||||
} else {
|
||||
uni.showToast({ title: this.$lang('searchAtBottom'), icon: 'none' })
|
||||
uni.showToast({ title: this.$lang('goods.list.search_at_bottom'), icon: 'none' })
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="tools-mask" @click="hideToolsPanel"></view>
|
||||
<view class="tools-panel">
|
||||
<view class="tools-header">
|
||||
<text>{{ $lang('moreFunctions') }}</text>
|
||||
<text>{{ $lang('common.list.more_functions') }}</text>
|
||||
<button class="close-btn" @click="hideToolsPanel">
|
||||
<text class="iconfont icon-close"></text>
|
||||
</button>
|
||||
@@ -13,25 +13,25 @@
|
||||
<view class="tool-icon">
|
||||
<text class="iconfont icon-image"></text>
|
||||
</view>
|
||||
<text class="tool-text">{{ $lang('image') }}</text>
|
||||
<text class="tool-text">{{ $lang('common.list.image') }}</text>
|
||||
</view>
|
||||
<view class="tool-item" @click="selectFile">
|
||||
<view class="tool-icon">
|
||||
<text class="iconfont icon-file"></text>
|
||||
</view>
|
||||
<text class="tool-text">{{ $lang('file') }}</text>
|
||||
<text class="tool-text">{{ $lang('common.list.file') }}</text>
|
||||
</view>
|
||||
<view class="tool-item" @click="startRecord">
|
||||
<view class="tool-icon">
|
||||
<text class="iconfont icon-voice"></text>
|
||||
</view>
|
||||
<text class="tool-text">{{ $lang('voice') }}</text>
|
||||
<text class="tool-text">{{ $lang('common.list.voice') }}</text>
|
||||
</view>
|
||||
<view class="tool-item" @click="selectLocation">
|
||||
<view class="tool-icon">
|
||||
<text class="iconfont icon-location"></text>
|
||||
</view>
|
||||
<text class="tool-text">{{ $lang('location') }}</text>
|
||||
<text class="tool-text">{{ $lang('common.list.location') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="voice-mask" @click="hideVoicePanel"></view>
|
||||
<view class="voice-input-panel">
|
||||
<view class="voice-header">
|
||||
<text>{{ $lang('voiceInputTitle') }}</text>
|
||||
<text>{{ $lang('common.list.voice_input_title') }}</text>
|
||||
<button class="close-btn" @click="hideVoicePanel">
|
||||
<text class="iconfont icon-close"></text>
|
||||
</button>
|
||||
@@ -16,7 +16,7 @@
|
||||
class="wave-bar"
|
||||
:style="{ animationDelay: (i * 0.1) + 's' }"></view>
|
||||
</view>
|
||||
<text class="voice-tip">{{ voiceInputing ? $lang('recordingTip') : $lang('startRecordTip') }}</text>
|
||||
<text class="voice-tip">{{ voiceInputing ? $lang('common.list.recording_tip') : $lang('common.list.start_record_tip') }}</text>
|
||||
</view>
|
||||
<view class="voice-actions">
|
||||
<button class="voice-btn" @click="toggleVoiceInput">
|
||||
@@ -86,7 +86,7 @@ export default {
|
||||
// 录音中,可扩展实时转文字
|
||||
})
|
||||
.catch(error => {
|
||||
uni.showToast({ title: this.$lang('voiceInputFailed'), icon: 'none' })
|
||||
uni.showToast({ title: this.$lang('common.list.voice_input_failed'), icon: 'none' })
|
||||
this.voiceInputing = false
|
||||
})
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,220 +1,220 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni @getData="getData" ref="mescroll" :style="tabBarPagePaddingStyle">
|
||||
<block slot="list">
|
||||
<view class="article-wrap" v-if="list.length">
|
||||
<ns-adv keyword="NS_ARTICLE" class-name="adv-wrap"></ns-adv>
|
||||
<view class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
|
||||
<view class="article-img">
|
||||
<image class="cover-img" :src="$util.img(item.cover_img)" mode="widthFix"
|
||||
@error="imgError(index)" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="info-wrap">
|
||||
<text class="title">{{ item.article_title }}</text>
|
||||
<view class="read-wrap">
|
||||
<block v-if="item.category_name">
|
||||
<text class="category-icon"></text>
|
||||
<text>{{ item.category_name }}</text>
|
||||
</block>
|
||||
<text class="date">{{ $util.timeStampTurnTime(item.create_time, 'date') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="empty-wrap"><ns-empty text="暂无文章" :isIndex="false"></ns-empty></view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.setPublicShare();
|
||||
},
|
||||
methods: {
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/article/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages_tool/article/detail', {
|
||||
article_id: item.article_id
|
||||
});
|
||||
},
|
||||
imgError(index) {
|
||||
if (this.list[index]) this.list[index].cover_img = this.$util.getDefaultImage().article;
|
||||
},
|
||||
// 设置公众号分享
|
||||
setPublicShare() {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/article/list';
|
||||
this.$util.setPublicShare({
|
||||
title: '文章列表',
|
||||
desc: '',
|
||||
link: shareUrl,
|
||||
imgUrl: this.siteInfo ? this.$util.img(this.siteInfo.logo_square) : ''
|
||||
});
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var title = '文章列表';
|
||||
var path = '/pages_tool/article/list';
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => { },
|
||||
fail: res => { }
|
||||
};
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline() {
|
||||
var title = '文章列表';
|
||||
var query = '/pages_tool/article/list';
|
||||
return {
|
||||
title: title,
|
||||
query: query,
|
||||
imageUrl: ''
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.empty-wrap {
|
||||
padding-top: 200rpx;
|
||||
}
|
||||
|
||||
.article-wrap {
|
||||
background: #f8f8f8;
|
||||
|
||||
.adv-wrap {
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
margin: 24rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.article-img {
|
||||
margin-right: 20rpx;
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.info-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
margin-bottom: 10rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: 30rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.abstract {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
|
||||
.read-wrap {
|
||||
display: flex;
|
||||
color: #999ca7;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 36rpx;
|
||||
vertical-align: bottom;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.category-icon {
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 50%;
|
||||
background: $base-color;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.date {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni @getData="getData" ref="mescroll" :style="tabBarPagePaddingStyle">
|
||||
<block slot="list">
|
||||
<view class="article-wrap" v-if="list.length">
|
||||
<ns-adv keyword="NS_ARTICLE" class-name="adv-wrap"></ns-adv>
|
||||
<view class="item" v-for="(item, index) in list" :key="index" @click="toDetail(item)">
|
||||
<view class="article-img">
|
||||
<image class="cover-img" :src="$util.img(item.cover_img)" mode="widthFix"
|
||||
@error="imgError(index)" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="info-wrap">
|
||||
<text class="title">{{ item.article_title }}</text>
|
||||
<view class="read-wrap">
|
||||
<block v-if="item.category_name">
|
||||
<text class="category-icon"></text>
|
||||
<text>{{ item.category_name }}</text>
|
||||
</block>
|
||||
<text class="date">{{ $util.timeStampTurnTime(item.create_time, 'date') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="empty-wrap"><ns-empty text="暂无文章" :isIndex="false"></ns-empty></view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: []
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.setPublicShare();
|
||||
},
|
||||
methods: {
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/article/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
toDetail(item) {
|
||||
this.$util.redirectTo('/pages_tool/article/detail', {
|
||||
article_id: item.article_id
|
||||
});
|
||||
},
|
||||
imgError(index) {
|
||||
if (this.list[index]) this.list[index].cover_img = this.$util.getDefaultImage().article;
|
||||
},
|
||||
// 设置公众号分享
|
||||
setPublicShare() {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/article/list';
|
||||
this.$util.setPublicShare({
|
||||
title: $lang('article.list.l91'),
|
||||
desc: '',
|
||||
link: shareUrl,
|
||||
imgUrl: this.siteInfo ? this.$util.img(this.siteInfo.logo_square) : ''
|
||||
});
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var title = $lang('article.list.l91');
|
||||
var path = '/pages_tool/article/list';
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => { },
|
||||
fail: res => { }
|
||||
};
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline() {
|
||||
var title = $lang('article.list.l91');
|
||||
var query = '/pages_tool/article/list';
|
||||
return {
|
||||
title: title,
|
||||
query: query,
|
||||
imageUrl: ''
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.empty-wrap {
|
||||
padding-top: 200rpx;
|
||||
}
|
||||
|
||||
.article-wrap {
|
||||
background: #f8f8f8;
|
||||
|
||||
.adv-wrap {
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
margin: 24rpx;
|
||||
border-radius: 16rpx;
|
||||
|
||||
.article-img {
|
||||
margin-right: 20rpx;
|
||||
width: 160rpx;
|
||||
height: 160rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.info-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
|
||||
.title {
|
||||
font-weight: bold;
|
||||
margin-bottom: 10rpx;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: 30rpx;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.abstract {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
|
||||
.read-wrap {
|
||||
display: flex;
|
||||
color: #999ca7;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 36rpx;
|
||||
vertical-align: bottom;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.category-icon {
|
||||
width: 8rpx;
|
||||
height: 8rpx;
|
||||
border-radius: 50%;
|
||||
background: $base-color;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
|
||||
.date {
|
||||
margin-left: 20rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,183 +1,183 @@
|
||||
<template>
|
||||
<view class="file-preview-container" :style="themeColor">
|
||||
<view class="header">
|
||||
<view class="back-btn" @click="goBack">
|
||||
<text class="iconfont icon-back"></text>
|
||||
</view>
|
||||
<view class="header-title">{{ fileName }}</view>
|
||||
<view class="placeholder"></view>
|
||||
</view>
|
||||
|
||||
<view class="content">
|
||||
<!-- PDF 文件预览 -->
|
||||
<view v-if="fileType === 'pdf'" class="file-viewer">
|
||||
<web-view v-if="fileUrl" :src="fileUrl"></web-view>
|
||||
<view v-else class="error-message">文件地址不存在</view>
|
||||
</view>
|
||||
|
||||
<!-- Word 文件预览 -->
|
||||
<view v-else-if="fileType === 'word'" class="file-viewer">
|
||||
<web-view v-if="fileUrl" :src="fileUrl"></web-view>
|
||||
<view v-else class="error-message">文件地址不存在</view>
|
||||
</view>
|
||||
|
||||
<!-- 视频文件预览 -->
|
||||
<view v-else-if="fileType === 'video'" class="video-viewer">
|
||||
<video v-if="fileUrl" :src="fileUrl" controls autoplay class="video-player"></video>
|
||||
<view v-else class="error-message">视频地址不存在</view>
|
||||
</view>
|
||||
|
||||
<!-- 其他文件类型 -->
|
||||
<view v-else class="file-viewer">
|
||||
<view class="error-message">不支持的文件类型</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
fileName: '',
|
||||
fileUrl: '',
|
||||
fileType: ''
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
// 解析传递的参数
|
||||
if (option.fileName) {
|
||||
this.fileName = decodeURIComponent(option.fileName);
|
||||
}
|
||||
|
||||
if (option.fileUrl) {
|
||||
this.fileUrl = decodeURIComponent(option.fileUrl);
|
||||
}
|
||||
|
||||
if (option.fileType) {
|
||||
this.fileType = decodeURIComponent(option.fileType);
|
||||
} else {
|
||||
// 根据文件名后缀推断文件类型
|
||||
this.inferFileType();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 根据文件名后缀推断文件类型
|
||||
*/
|
||||
inferFileType() {
|
||||
if (this.fileName) {
|
||||
const ext = this.fileName.split('.').pop().toLowerCase();
|
||||
if (['pdf'].includes(ext)) {
|
||||
this.fileType = 'pdf';
|
||||
} else if (['doc', 'docx'].includes(ext)) {
|
||||
this.fileType = 'word';
|
||||
} else if (['mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv'].includes(ext)) {
|
||||
this.fileType = 'video';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回上一页
|
||||
*/
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.file-preview-container {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 100rpx;
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.back-btn {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.icon-back {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.header-title {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
width: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 20rpx;
|
||||
|
||||
.file-viewer {
|
||||
width: 100%;
|
||||
min-height: 80vh;
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.error-message {
|
||||
width: 100%;
|
||||
height: 80vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.video-viewer {
|
||||
width: 100%;
|
||||
min-height: 80vh;
|
||||
background-color: #000;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.video-player {
|
||||
width: 100%;
|
||||
height: 80vh;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
width: 100%;
|
||||
height: 80vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
background-color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="file-preview-container" :style="themeColor">
|
||||
<view class="header">
|
||||
<view class="back-btn" @click="goBack">
|
||||
<text class="iconfont icon-back"></text>
|
||||
</view>
|
||||
<view class="header-title">{{ fileName }}</view>
|
||||
<view class="placeholder"></view>
|
||||
</view>
|
||||
|
||||
<view class="content">
|
||||
<!-- PDF 文件预览 -->
|
||||
<view v-if="fileType === 'pdf'" class="file-viewer">
|
||||
<web-view v-if="fileUrl" :src="fileUrl"></web-view>
|
||||
<view v-else class="error-message">{{ $lang("tool.file-preview.l15.t0") }}</view>
|
||||
</view>
|
||||
|
||||
<!-- Word 文件预览 -->
|
||||
<view v-else-if="fileType === 'word'" class="file-viewer">
|
||||
<web-view v-if="fileUrl" :src="fileUrl"></web-view>
|
||||
<view v-else class="error-message">{{ $lang("tool.file-preview.l15.t0") }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 视频文件预览 -->
|
||||
<view v-else-if="fileType === 'video'" class="video-viewer">
|
||||
<video v-if="fileUrl" :src="fileUrl" controls autoplay class="video-player"></video>
|
||||
<view v-else class="error-message">{{ $lang("common.ns-video-player-popup.l17.t0") }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 其他文件类型 -->
|
||||
<view v-else class="file-viewer">
|
||||
<view class="error-message">{{ $lang("tool.file-preview.l32.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
fileName: '',
|
||||
fileUrl: '',
|
||||
fileType: ''
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
// 解析传递的参数
|
||||
if (option.fileName) {
|
||||
this.fileName = decodeURIComponent(option.fileName);
|
||||
}
|
||||
|
||||
if (option.fileUrl) {
|
||||
this.fileUrl = decodeURIComponent(option.fileUrl);
|
||||
}
|
||||
|
||||
if (option.fileType) {
|
||||
this.fileType = decodeURIComponent(option.fileType);
|
||||
} else {
|
||||
// 根据文件名后缀推断文件类型
|
||||
this.inferFileType();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 根据文件名后缀推断文件类型
|
||||
*/
|
||||
inferFileType() {
|
||||
if (this.fileName) {
|
||||
const ext = this.fileName.split('.').pop().toLowerCase();
|
||||
if (['pdf'].includes(ext)) {
|
||||
this.fileType = 'pdf';
|
||||
} else if (['doc', 'docx'].includes(ext)) {
|
||||
this.fileType = 'word';
|
||||
} else if (['mp4', 'avi', 'mov', 'wmv', 'flv', 'mkv'].includes(ext)) {
|
||||
this.fileType = 'video';
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回上一页
|
||||
*/
|
||||
goBack() {
|
||||
uni.navigateBack();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.file-preview-container {
|
||||
min-height: 100vh;
|
||||
background-color: #f5f5f5;
|
||||
|
||||
.header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
height: 100rpx;
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.back-btn {
|
||||
width: 60rpx;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
.icon-back {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
}
|
||||
}
|
||||
|
||||
.header-title {
|
||||
flex: 1;
|
||||
font-size: 32rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.placeholder {
|
||||
width: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
flex: 1;
|
||||
padding: 20rpx;
|
||||
|
||||
.file-viewer {
|
||||
width: 100%;
|
||||
min-height: 80vh;
|
||||
background-color: #fff;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.error-message {
|
||||
width: 100%;
|
||||
height: 80vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.video-viewer {
|
||||
width: 100%;
|
||||
min-height: 80vh;
|
||||
background-color: #000;
|
||||
border-radius: 12rpx;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
|
||||
|
||||
.video-player {
|
||||
width: 100%;
|
||||
height: 80vh;
|
||||
}
|
||||
|
||||
.error-message {
|
||||
width: 100%;
|
||||
height: 80vh;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
background-color: #000;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,270 +1,270 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="search-wrap uni-flex uni-row">
|
||||
<view class="flex-item input-wrap">
|
||||
<input class="uni-input" maxlength="50" placeholder="请输入您要搜索的文件名称" v-model="keyword" @confirm="search"
|
||||
@input="__set_model($event, 'keyword')" />
|
||||
<text class="iconfont icon-sousuo3" @tap="search"></text>
|
||||
</view>
|
||||
</view>
|
||||
<mescroll-uni ref="mescroll" top="100" @getData="getData" :style="tabBarPagePaddingStyle">
|
||||
<view slot="list">
|
||||
<block v-if="list.length > 0">
|
||||
<view class="article-wrap">
|
||||
<ns-adv keyword="NS_ARTICLE" class-name="adv-wrap"></ns-adv>
|
||||
<block v-for="(item, index) in list" :key="index">
|
||||
<view class="item" @tap="toDetail(item.$orig)">
|
||||
<view class="article-img">
|
||||
<image class="cover-img" :src="item.g1" mode="widthFix" @error="imgError(index)" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="info-wrap">
|
||||
<view class="title">{{ item.$orig.files_title }}</view>
|
||||
<view class="read-wrap">
|
||||
<text>查看PDF文件</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="empty-wrap">
|
||||
<ns-empty text="暂无文件" :isIndex="false"></ns-empty>
|
||||
</view>
|
||||
</block>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
category_id: '',
|
||||
list: [],
|
||||
title: '',
|
||||
keyword: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.category_id > 0) {
|
||||
this.category_id = options.category_id
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
methods: {
|
||||
__set_model(event, field) {
|
||||
this[field] = event.detail.value
|
||||
},
|
||||
search() {
|
||||
this.list = []
|
||||
this.$refs.mescroll.refresh()
|
||||
},
|
||||
getData(page) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/files/getpage',
|
||||
data: {
|
||||
page_size: page.size,
|
||||
page: page.num,
|
||||
category_id: this.category_id,
|
||||
keyword: this.keyword
|
||||
},
|
||||
success: res => {
|
||||
let list = []
|
||||
let message = res.message
|
||||
if (res.code === 0 && res.data) {
|
||||
list = res.data.list
|
||||
if (!this.title && res.data.list.length > 0) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.data.list[0].category_name
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: message
|
||||
})
|
||||
}
|
||||
page.endSuccess(list.length)
|
||||
if (page.num === 1) {
|
||||
this.list = []
|
||||
}
|
||||
this.list = this.list.concat(list.map(item => {
|
||||
const orig = item
|
||||
const g1 = this.$util.img("addon/personnel/shop/view/enterprise/fileicon.png")
|
||||
return { $orig: orig, g1: g1 }
|
||||
}))
|
||||
if (this.$refs.loadingCover) {
|
||||
this.$refs.loadingCover.hide()
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
page.endErr()
|
||||
if (this.$refs.loadingCover) {
|
||||
this.$refs.loadingCover.hide()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetail(item) {
|
||||
uni.showLoading({
|
||||
title: '正在加载'
|
||||
})
|
||||
try {
|
||||
uni.downloadFile({
|
||||
url: item.files_url,
|
||||
success: res => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
},
|
||||
fail: () => {
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading()
|
||||
},
|
||||
complete: res => {
|
||||
if (res.statusCode === 404) {
|
||||
uni.showToast({
|
||||
title: '文件不存在',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
imgError(index) {
|
||||
if (this.list[index]) {
|
||||
this.list[index].cover_img = this.$util.getDefaultImage().article
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search-wrap {
|
||||
flex: 0.5;
|
||||
padding: 30rpx 30rpx 0;
|
||||
font-size: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.search-wrap .iconfont {
|
||||
margin-left: 16rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.search-wrap .input-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
height: 64rpx;
|
||||
padding-left: 10rpx;
|
||||
border-radius: 70rpx;
|
||||
}
|
||||
|
||||
.search-wrap .input-wrap input {
|
||||
width: 90%;
|
||||
background: #fff;
|
||||
font-size: 24rpx;
|
||||
height: 100%;
|
||||
padding: 0 25rpx 0 40rpx;
|
||||
line-height: 50rpx;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
|
||||
.search-wrap .input-wrap text {
|
||||
font-size: 32rpx;
|
||||
color: #909399;
|
||||
width: 80rpx;
|
||||
text-align: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.empty-wrap {
|
||||
padding-top: 200rpx;
|
||||
}
|
||||
|
||||
.article-wrap {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.article-wrap .adv-wrap {
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.article-wrap .item {
|
||||
display: flex;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
margin: 24rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.article-wrap .item .article-img {
|
||||
margin-right: 20rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.article-wrap .item .article-img image {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.article-wrap .item .info-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.article-wrap .item .info-wrap .title {
|
||||
font-weight: 700;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.article-wrap .item .info-wrap .read-wrap {
|
||||
display: flex;
|
||||
color: #999ca7;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.article-wrap .item .info-wrap .read-wrap text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
<template>
|
||||
<view>
|
||||
<view class="search-wrap uni-flex uni-row">
|
||||
<view class="flex-item input-wrap">
|
||||
<input class="uni-input" maxlength="50" placeholder=$lang("tool.files.list.l5.t0") v-model="keyword" @confirm="search"
|
||||
@input="__set_model($event, 'keyword')" />
|
||||
<text class="iconfont icon-sousuo3" @tap="search"></text>
|
||||
</view>
|
||||
</view>
|
||||
<mescroll-uni ref="mescroll" top="100" @getData="getData" :style="tabBarPagePaddingStyle">
|
||||
<view slot="list">
|
||||
<block v-if="list.length > 0">
|
||||
<view class="article-wrap">
|
||||
<ns-adv keyword="NS_ARTICLE" class-name="adv-wrap"></ns-adv>
|
||||
<block v-for="(item, index) in list" :key="index">
|
||||
<view class="item" @tap="toDetail(item.$orig)">
|
||||
<view class="article-img">
|
||||
<image class="cover-img" :src="item.g1" mode="widthFix" @error="imgError(index)" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="info-wrap">
|
||||
<view class="title">{{ item.$orig.files_title }}</view>
|
||||
<view class="read-wrap">
|
||||
<text>{{ $lang("tool.cases.index.l31.t0") }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="empty-wrap">
|
||||
<ns-empty text="暂无文件" :isIndex="false"></ns-empty>
|
||||
</view>
|
||||
</block>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
category_id: '',
|
||||
list: [],
|
||||
title: '',
|
||||
keyword: ''
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.category_id > 0) {
|
||||
this.category_id = options.category_id
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
methods: {
|
||||
__set_model(event, field) {
|
||||
this[field] = event.detail.value
|
||||
},
|
||||
search() {
|
||||
this.list = []
|
||||
this.$refs.mescroll.refresh()
|
||||
},
|
||||
getData(page) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/files/getpage',
|
||||
data: {
|
||||
page_size: page.size,
|
||||
page: page.num,
|
||||
category_id: this.category_id,
|
||||
keyword: this.keyword
|
||||
},
|
||||
success: res => {
|
||||
let list = []
|
||||
let message = res.message
|
||||
if (res.code === 0 && res.data) {
|
||||
list = res.data.list
|
||||
if (!this.title && res.data.list.length > 0) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: res.data.list[0].category_name
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: message
|
||||
})
|
||||
}
|
||||
page.endSuccess(list.length)
|
||||
if (page.num === 1) {
|
||||
this.list = []
|
||||
}
|
||||
this.list = this.list.concat(list.map(item => {
|
||||
const orig = item
|
||||
const g1 = this.$util.img("addon/personnel/shop/view/enterprise/fileicon.png")
|
||||
return { $orig: orig, g1: g1 }
|
||||
}))
|
||||
if (this.$refs.loadingCover) {
|
||||
this.$refs.loadingCover.hide()
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
page.endErr()
|
||||
if (this.$refs.loadingCover) {
|
||||
this.$refs.loadingCover.hide()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
toDetail(item) {
|
||||
uni.showLoading({
|
||||
title: $lang('tool.cases.index.l143.t0')
|
||||
})
|
||||
try {
|
||||
uni.downloadFile({
|
||||
url: item.files_url,
|
||||
success: res => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
},
|
||||
fail: () => {
|
||||
},
|
||||
complete: () => {
|
||||
uni.hideLoading()
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading()
|
||||
},
|
||||
complete: res => {
|
||||
if (res.statusCode === 404) {
|
||||
uni.showToast({
|
||||
title: $lang('tool.cases.index.l167.t0'),
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
} catch (e) {
|
||||
uni.hideLoading()
|
||||
}
|
||||
},
|
||||
imgError(index) {
|
||||
if (this.list[index]) {
|
||||
this.list[index].cover_img = this.$util.getDefaultImage().article
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.search-wrap {
|
||||
flex: 0.5;
|
||||
padding: 30rpx 30rpx 0;
|
||||
font-size: 24rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.search-wrap .iconfont {
|
||||
margin-left: 16rpx;
|
||||
font-size: 36rpx;
|
||||
}
|
||||
|
||||
.search-wrap .input-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background: #fff;
|
||||
height: 64rpx;
|
||||
padding-left: 10rpx;
|
||||
border-radius: 70rpx;
|
||||
}
|
||||
|
||||
.search-wrap .input-wrap input {
|
||||
width: 90%;
|
||||
background: #fff;
|
||||
font-size: 24rpx;
|
||||
height: 100%;
|
||||
padding: 0 25rpx 0 40rpx;
|
||||
line-height: 50rpx;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
|
||||
.search-wrap .input-wrap text {
|
||||
font-size: 32rpx;
|
||||
color: #909399;
|
||||
width: 80rpx;
|
||||
text-align: center;
|
||||
margin-right: 20rpx;
|
||||
}
|
||||
|
||||
.empty-wrap {
|
||||
padding-top: 200rpx;
|
||||
}
|
||||
|
||||
.article-wrap {
|
||||
background: #f8f8f8;
|
||||
}
|
||||
|
||||
.article-wrap .adv-wrap {
|
||||
margin: 24rpx 24rpx 0 24rpx;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.article-wrap .item {
|
||||
display: flex;
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
margin: 24rpx;
|
||||
border-radius: 16rpx;
|
||||
}
|
||||
|
||||
.article-wrap .item .article-img {
|
||||
margin-right: 20rpx;
|
||||
width: 80rpx;
|
||||
height: 80rpx;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.article-wrap .item .article-img image {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.article-wrap .item .info-wrap {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.article-wrap .item .info-wrap .title {
|
||||
font-weight: 700;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 1;
|
||||
-webkit-box-orient: vertical;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.article-wrap .item .info-wrap .read-wrap {
|
||||
display: flex;
|
||||
color: #999ca7;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
margin-top: 10rpx;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.article-wrap .item .info-wrap .read-wrap text {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -1,147 +1,147 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="page" v-if="detail">
|
||||
<view class="form-banner">
|
||||
<image :src="$util.img('public/uniapp/form/banner.png')" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="system-form-wrap">
|
||||
<view class="form-title">请填写表单所需信息</view>
|
||||
<ns-form :data="detail.json_data" :formConfig="detail.form_config" ref="form"></ns-form>
|
||||
<button type="primary" size="mini" class="button mini" @click="create()">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
<ns-empty :text="complete ? '提交成功' : '未获取到表单信息'" v-else></ns-empty>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: null,
|
||||
isRepeat: false,
|
||||
complete: false,
|
||||
scroll:true
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
// #ifdef MP-ALIPAY
|
||||
let options = my.getLaunchOptionsSync();
|
||||
options.query && Object.assign(data, options.query)
|
||||
// #endif
|
||||
|
||||
this.id = data.id || 0;
|
||||
if (data.scene) {
|
||||
var sceneParams = decodeURIComponent(data.scene);
|
||||
sceneParams = sceneParams.split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
if (item.indexOf('id') != -1) this.id = item.split('-')[1];
|
||||
});
|
||||
}
|
||||
}
|
||||
if (this.storeToken) {
|
||||
this.getData();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/form/form?id=' + this.id)
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) this.getData();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/info',
|
||||
data: {
|
||||
form_id: this.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.detail = res.data;
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
if (this.$refs.form.verify()) {
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/create',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
form_data: JSON.stringify(this.$refs.form.formData)
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({ title: '提交成功' })
|
||||
setTimeout(() => {
|
||||
this.complete = true;
|
||||
this.detail = null;
|
||||
}, 1500)
|
||||
} else {
|
||||
this.isRepeat = false;
|
||||
this.$util.showToast({ title: res.message })
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.form-banner {
|
||||
width: 100vw;
|
||||
line-height: 1;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.system-form-wrap {
|
||||
background: $color-bg;
|
||||
border-radius: 32rpx;
|
||||
overflow: hidden;
|
||||
margin: 0 0 60rpx 0;
|
||||
padding: 0 26rpx;
|
||||
transform: translateY(-40rpx);
|
||||
|
||||
.form-title {
|
||||
line-height: 100rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.button {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx !important;
|
||||
margin-top: 30rpx !important;
|
||||
width: 100%;
|
||||
border-radius: 80rpx;
|
||||
}
|
||||
|
||||
::v-deep .form-wrap {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="page" v-if="detail">
|
||||
<view class="form-banner">
|
||||
<image :src="$util.img('public/uniapp/form/banner.png')" mode="widthFix"></image>
|
||||
</view>
|
||||
<view class="system-form-wrap">
|
||||
<view class="form-title">{{ $lang("tool.form.l8.t0") }}</view>
|
||||
<ns-form :data="detail.json_data" :formConfig="detail.form_config" ref="form"></ns-form>
|
||||
<button type="primary" size="mini" class="button mini" @click="create()">{{ $lang("diy.diy-form.l142.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<ns-empty :text="complete ? '提交成功' : '未获取到表单信息'" v-else></ns-empty>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: null,
|
||||
isRepeat: false,
|
||||
complete: false,
|
||||
scroll:true
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
// #ifdef MP-ALIPAY
|
||||
let options = my.getLaunchOptionsSync();
|
||||
options.query && Object.assign(data, options.query)
|
||||
// #endif
|
||||
|
||||
this.id = data.id || 0;
|
||||
if (data.scene) {
|
||||
var sceneParams = decodeURIComponent(data.scene);
|
||||
sceneParams = sceneParams.split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
if (item.indexOf('id') != -1) this.id = item.split('-')[1];
|
||||
});
|
||||
}
|
||||
}
|
||||
if (this.storeToken) {
|
||||
this.getData();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/form/form?id=' + this.id)
|
||||
})
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) this.getData();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/info',
|
||||
data: {
|
||||
form_id: this.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.detail = res.data;
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
if (this.$refs.form.verify()) {
|
||||
if (this.isRepeat) return;
|
||||
this.isRepeat = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/create',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
form_data: JSON.stringify(this.$refs.form.formData)
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({ title: $lang('diy.diy-form.l306.t0') })
|
||||
setTimeout(() => {
|
||||
this.complete = true;
|
||||
this.detail = null;
|
||||
}, 1500)
|
||||
} else {
|
||||
this.isRepeat = false;
|
||||
this.$util.showToast({ title: res.message })
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
||||
.form-banner {
|
||||
width: 100vw;
|
||||
line-height: 1;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.system-form-wrap {
|
||||
background: $color-bg;
|
||||
border-radius: 32rpx;
|
||||
overflow: hidden;
|
||||
margin: 0 0 60rpx 0;
|
||||
padding: 0 26rpx;
|
||||
transform: translateY(-40rpx);
|
||||
|
||||
.form-title {
|
||||
line-height: 100rpx;
|
||||
padding-top: 20rpx;
|
||||
}
|
||||
|
||||
.button {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx !important;
|
||||
margin-top: 30rpx !important;
|
||||
width: 100%;
|
||||
border-radius: 80rpx;
|
||||
}
|
||||
|
||||
::v-deep .form-wrap {
|
||||
background: #fff;
|
||||
padding: 30rpx;
|
||||
border-radius: 32rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,199 +1,199 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<block v-if="detail">
|
||||
<view class="page">
|
||||
<view class="system-form-wrap">
|
||||
<!-- 复用 diy-form:banner / tip / 表单字段 / 提交按钮 全部由其内部渲染,样式(bannerPaddingX/tipColor/submitBgColor 等)由 form_config 控制。
|
||||
@submit 接管提交逻辑(带 uniacid + showModal) -->
|
||||
<diy-form
|
||||
ref="form"
|
||||
:value="diyValue"
|
||||
dataMode="raw"
|
||||
@submit="create"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-empty :text="complete ? '提交成功' : '未获取到表单信息'" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import diyForm from '@/components-diy/diy-form.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
diyForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: null,
|
||||
isRepeat: false,
|
||||
complete: false,
|
||||
scroll: true,
|
||||
uniacid: 0,
|
||||
isFromMpWebView: false, // 是否是从微信小程序的WebView跳转过来的
|
||||
|
||||
// #ifdef H5
|
||||
formTitle: '', // 查询参数传入的Title
|
||||
enableSetTitle: false, // 查询参数传入的是否可以强制设置Title
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 构造 diy-form raw 模式期望的 value 形态:
|
||||
// - jsonData:透传给 ns-newform(已是 ns-newform 期望的 [{ controller, value, val }])
|
||||
// - formConfig:后端返回 camelCase(如 formPaddingX / formBgColor / labelFontSize),
|
||||
// diy-form 内部 mergedFormConfig 同时兼容 snake_case 后再交给 ns-newform
|
||||
// - show_banner / form_banner:交给 diy-form 渲染 banner,样式走 form_config.bannerPaddingX;form_banner 给保底图
|
||||
// - show_tip / form_tip:交给 diy-form 渲染 tip,样式走 form_config;form_tip 给保底文案
|
||||
// 注:本 computed 只在 <block v-if="detail"> 内被消费,无需 null 守卫
|
||||
diyValue() {
|
||||
return {
|
||||
jsonData: this.detail.json_data,
|
||||
formConfig: this.detail.form_config,
|
||||
show_banner: this.detail.show_banner,
|
||||
form_banner: this.detail.form_banner || 'public/uniapp/form/banner.png',
|
||||
show_tip: this.detail.show_tip,
|
||||
form_tip: this.detail.form_tip || '请填写表单所需信息'
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (!options.uniacid) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '参数错误',
|
||||
showCancel: false,
|
||||
success: () => { }
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
uni.setStorageSync('skipPrivacyCheck', true);
|
||||
|
||||
// #ifdef H5
|
||||
this.formTitle = options?.title ?? '';
|
||||
this.enableSetTitle = options?.enable_set_title == 1;
|
||||
// #endif
|
||||
|
||||
this.uniacid = options.uniacid
|
||||
this.id = options.id || 0
|
||||
this.isFromMpWebView = options.from === 'mp-webview';
|
||||
|
||||
if (options.scene) {
|
||||
const scene = decodeURIComponent(options.scene)
|
||||
const params = scene.split('&')
|
||||
params.length && params.forEach(item => {
|
||||
if (item.indexOf('id') != -1) {
|
||||
this.id = item.split('-')[1]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// #ifdef H5
|
||||
if (this.isFromMpWebView) {
|
||||
this.$nextTick(() => {
|
||||
const navbar = document.querySelector('uni-page-head')
|
||||
if (navbar) navbar.style.display = 'none'
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
|
||||
this.getData()
|
||||
},
|
||||
|
||||
watch: {
|
||||
storeToken(newVal, oldVal) {
|
||||
newVal && this.getData()
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.updateNavbarTitle();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/info',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
uniacid: this.uniacid
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.detail = res.data
|
||||
this.updateNavbarTitle();
|
||||
}
|
||||
this.$refs.loadingCover && this.$refs.loadingCover.hide()
|
||||
},
|
||||
fail: () => {
|
||||
this.$refs.loadingCover && this.$refs.loadingCover.hide()
|
||||
}
|
||||
})
|
||||
},
|
||||
updateNavbarTitle() {
|
||||
if (!this.detail?.form_name) return;
|
||||
let formName = this.detail.form_name;
|
||||
// #ifdef H5
|
||||
if (this.enableSetTitle && this.formTitle) {
|
||||
formName = this.formTitle;
|
||||
}
|
||||
// #endif
|
||||
uni.setNavigationBarTitle({ title: formName });
|
||||
},
|
||||
// 由 diy-form 内置提交按钮触发:diy-form 已先做 verify(),仅在通过时才 emit('submit', formData)
|
||||
create(formData) {
|
||||
if (this.isRepeat) return
|
||||
|
||||
this.isRepeat = true
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/create',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
form_data: JSON.stringify(formData),
|
||||
uniacid: this.uniacid
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '提交成功',
|
||||
showCancel: false,
|
||||
success: () => { }
|
||||
})
|
||||
} else {
|
||||
this.isRepeat = false
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.system-form-wrap {
|
||||
overflow: hidden;
|
||||
margin: 0 0 60rpx 0;
|
||||
}
|
||||
|
||||
// 穿透 diy-form 包装层:消除其自带的 10rpx 圆角与白色背景,
|
||||
// 让 form 内容区域保持与原始 ns-newform 接入时一致的视觉
|
||||
.system-form-wrap ::v-deep .diy-from {
|
||||
background: transparent;
|
||||
border-radius: 0;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<block v-if="detail">
|
||||
<view class="page">
|
||||
<view class="system-form-wrap">
|
||||
<!-- 复用 diy-form:banner / tip / 表单字段 / 提交按钮 全部由其内部渲染,样式(bannerPaddingX/tipColor/submitBgColor 等)由 form_config 控制。
|
||||
@submit 接管提交逻辑(带 uniacid + showModal) -->
|
||||
<diy-form
|
||||
ref="form"
|
||||
:value="diyValue"
|
||||
dataMode="raw"
|
||||
@submit="create"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-empty :text="complete ? '提交成功' : '未获取到表单信息'" :isIndex="false"></ns-empty>
|
||||
</block>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import diyForm from '@/components-diy/diy-form.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
diyForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: null,
|
||||
isRepeat: false,
|
||||
complete: false,
|
||||
scroll: true,
|
||||
uniacid: 0,
|
||||
isFromMpWebView: false, // 是否是从微信小程序的WebView跳转过来的
|
||||
|
||||
// #ifdef H5
|
||||
formTitle: '', // 查询参数传入的Title
|
||||
enableSetTitle: false, // 查询参数传入的是否可以强制设置Title
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 构造 diy-form raw 模式期望的 value 形态:
|
||||
// - jsonData:透传给 ns-newform(已是 ns-newform 期望的 [{ controller, value, val }])
|
||||
// - formConfig:后端返回 camelCase(如 formPaddingX / formBgColor / labelFontSize),
|
||||
// diy-form 内部 mergedFormConfig 同时兼容 snake_case 后再交给 ns-newform
|
||||
// - show_banner / form_banner:交给 diy-form 渲染 banner,样式走 form_config.bannerPaddingX;form_banner 给保底图
|
||||
// - show_tip / form_tip:交给 diy-form 渲染 tip,样式走 form_config;form_tip 给保底文案
|
||||
// 注:本 computed 只在 <block v-if="detail"> 内被消费,无需 null 守卫
|
||||
diyValue() {
|
||||
return {
|
||||
jsonData: this.detail.json_data,
|
||||
formConfig: this.detail.form_config,
|
||||
show_banner: this.detail.show_banner,
|
||||
form_banner: this.detail.form_banner || 'public/uniapp/form/banner.png',
|
||||
show_tip: this.detail.show_tip,
|
||||
form_tip: this.detail.form_tip || $lang('tool.form.l8.t0')
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (!options.uniacid) {
|
||||
uni.showModal({
|
||||
title: $lang('common.wxwork-contact.l202.t0'),
|
||||
content: $lang('tool.form.formdata.l72.t0'),
|
||||
showCancel: false,
|
||||
success: () => { }
|
||||
})
|
||||
return false
|
||||
}
|
||||
|
||||
uni.setStorageSync('skipPrivacyCheck', true);
|
||||
|
||||
// #ifdef H5
|
||||
this.formTitle = options?.title ?? '';
|
||||
this.enableSetTitle = options?.enable_set_title == 1;
|
||||
// #endif
|
||||
|
||||
this.uniacid = options.uniacid
|
||||
this.id = options.id || 0
|
||||
this.isFromMpWebView = options.from === 'mp-webview';
|
||||
|
||||
if (options.scene) {
|
||||
const scene = decodeURIComponent(options.scene)
|
||||
const params = scene.split('&')
|
||||
params.length && params.forEach(item => {
|
||||
if (item.indexOf('id') != -1) {
|
||||
this.id = item.split('-')[1]
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// #ifdef H5
|
||||
if (this.isFromMpWebView) {
|
||||
this.$nextTick(() => {
|
||||
const navbar = document.querySelector('uni-page-head')
|
||||
if (navbar) navbar.style.display = 'none'
|
||||
})
|
||||
}
|
||||
// #endif
|
||||
|
||||
this.getData()
|
||||
},
|
||||
|
||||
watch: {
|
||||
storeToken(newVal, oldVal) {
|
||||
newVal && this.getData()
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.updateNavbarTitle();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/info',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
uniacid: this.uniacid
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.detail = res.data
|
||||
this.updateNavbarTitle();
|
||||
}
|
||||
this.$refs.loadingCover && this.$refs.loadingCover.hide()
|
||||
},
|
||||
fail: () => {
|
||||
this.$refs.loadingCover && this.$refs.loadingCover.hide()
|
||||
}
|
||||
})
|
||||
},
|
||||
updateNavbarTitle() {
|
||||
if (!this.detail?.form_name) return;
|
||||
let formName = this.detail.form_name;
|
||||
// #ifdef H5
|
||||
if (this.enableSetTitle && this.formTitle) {
|
||||
formName = this.formTitle;
|
||||
}
|
||||
// #endif
|
||||
uni.setNavigationBarTitle({ title: formName });
|
||||
},
|
||||
// 由 diy-form 内置提交按钮触发:diy-form 已先做 verify(),仅在通过时才 emit('submit', formData)
|
||||
create(formData) {
|
||||
if (this.isRepeat) return
|
||||
|
||||
this.isRepeat = true
|
||||
this.$api.sendRequest({
|
||||
url: '/form/api/form/create',
|
||||
data: {
|
||||
form_id: this.id,
|
||||
form_data: JSON.stringify(formData),
|
||||
uniacid: this.uniacid
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
uni.showModal({
|
||||
title: $lang('common.wxwork-contact.l202.t0'),
|
||||
content: $lang('diy.diy-form.l306.t0'),
|
||||
showCancel: false,
|
||||
success: () => { }
|
||||
})
|
||||
} else {
|
||||
this.isRepeat = false
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
page {
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.system-form-wrap {
|
||||
overflow: hidden;
|
||||
margin: 0 0 60rpx 0;
|
||||
}
|
||||
|
||||
// 穿透 diy-form 包装层:消除其自带的 10rpx 圆角与白色背景,
|
||||
// 让 form 内容区域保持与原始 ns-newform 接入时一致的视觉
|
||||
.system-form-wrap ::v-deep .diy-from {
|
||||
background: transparent;
|
||||
border-radius: 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,120 +1,120 @@
|
||||
<template>
|
||||
<view :data-theme="themeStyle">
|
||||
<mescroll-uni @getData="getBrandList" ref="mescroll" size="20" :style="tabBarPagePaddingStyle">
|
||||
<block slot="list">
|
||||
<ns-adv keyword="NS_BRAND" class-name="adv-wrap"></ns-adv>
|
||||
<view class="brand-content" v-if="brandList.length > 0">
|
||||
<uni-grid :column="3" @change="change" :showBorder="!1">
|
||||
<uni-grid-item v-for="(item, index) in brandList" :key="index" index="index">
|
||||
<image class="brand-pic" :src="$util.img(item.image_url)" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="brand_name">{{ item.brand_name }}</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</view>
|
||||
<view v-if="brandList.length == 0"><ns-empty text="暂无更多品牌,去首页看看吧"></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
brandList: [],
|
||||
siteId: 0
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.site_id) this.siteId = options.site_id;
|
||||
},
|
||||
onShow() { },
|
||||
methods: {
|
||||
change(e) {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
brand_id: this.brandList[e.detail.index].brand_id
|
||||
});
|
||||
},
|
||||
getBrandList(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsbrand/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num,
|
||||
site_id: this.siteId
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.brandList = []; //如果是第一页需手动制空列表
|
||||
this.brandList = this.brandList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var title = '你想要的大牌都在这里';
|
||||
var path = '/pages_tool/goods/brand';
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => { },
|
||||
fail: res => { }
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .uni-grid-item {
|
||||
width: calc((100vw - (#{$margin-both} * 2)) / 3) !important;
|
||||
}
|
||||
|
||||
.adv-wrap {
|
||||
margin: $margin-updown $margin-both;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.brand-content {
|
||||
padding: $padding 0;
|
||||
box-sizing: border-box;
|
||||
background: #ffffff;
|
||||
margin: $margin-updown $margin-both 0;
|
||||
|
||||
.brand-pic {
|
||||
width: 60%;
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.brand_name {
|
||||
width: 70%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :data-theme="themeStyle">
|
||||
<mescroll-uni @getData="getBrandList" ref="mescroll" size="20" :style="tabBarPagePaddingStyle">
|
||||
<block slot="list">
|
||||
<ns-adv keyword="NS_BRAND" class-name="adv-wrap"></ns-adv>
|
||||
<view class="brand-content" v-if="brandList.length > 0">
|
||||
<uni-grid :column="3" @change="change" :showBorder="!1">
|
||||
<uni-grid-item v-for="(item, index) in brandList" :key="index" index="index">
|
||||
<image class="brand-pic" :src="$util.img(item.image_url)" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="brand_name">{{ item.brand_name }}</view>
|
||||
</uni-grid-item>
|
||||
</uni-grid>
|
||||
</view>
|
||||
<view v-if="brandList.length == 0"><ns-empty text=$lang("tool.goods.brand.l14.t0")></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
brandList: [],
|
||||
siteId: 0
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.site_id) this.siteId = options.site_id;
|
||||
},
|
||||
onShow() { },
|
||||
methods: {
|
||||
change(e) {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
brand_id: this.brandList[e.detail.index].brand_id
|
||||
});
|
||||
},
|
||||
getBrandList(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsbrand/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num,
|
||||
site_id: this.siteId
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.brandList = []; //如果是第一页需手动制空列表
|
||||
this.brandList = this.brandList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var title = $lang('tool.goods.brand.l79.t0');
|
||||
var path = '/pages_tool/goods/brand';
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => { },
|
||||
fail: res => { }
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .uni-grid-item {
|
||||
width: calc((100vw - (#{$margin-both} * 2)) / 3) !important;
|
||||
}
|
||||
|
||||
.adv-wrap {
|
||||
margin: $margin-updown $margin-both;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
.brand-content {
|
||||
padding: $padding 0;
|
||||
box-sizing: border-box;
|
||||
background: #ffffff;
|
||||
margin: $margin-updown $margin-both 0;
|
||||
|
||||
.brand-pic {
|
||||
width: 60%;
|
||||
height: 50%;
|
||||
}
|
||||
|
||||
.brand_name {
|
||||
width: 70%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,474 +1,474 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="cf-container color-line-border">
|
||||
<view class="tab">
|
||||
<view @click="changeSort(1)"><text
|
||||
:class="sort == 1 ? 'color-base-text active color-base-border-bottom' : ''">全部</text></view>
|
||||
<view @click="changeSort(2, 'reward')"><text
|
||||
:class="sort == 2 ? 'color-base-text active color-base-border-bottom' : ''">满减券</text></view>
|
||||
<view @click="changeSort(3, 'discount')"><text
|
||||
:class="sort == 3 ? 'color-base-text active color-base-border-bottom' : ''">折扣券</text></view>
|
||||
<!-- <view @click="changeSort(4, 'no_threshold')"><text :class="sort == 4 ? 'color-base-text active color-base-border-bottom' : ''">无门槛券</text></view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<mescroll-uni ref="mescroll" top="100" @getData="getMemberCouponList" :style="tabBarPagePaddingStyle">
|
||||
<block slot="list">
|
||||
<view class="coupon-listone">
|
||||
<view class="item" v-for="(item, index) in list" :key="index" @click="liClick(item, index)"
|
||||
:style="{ backgroundColor: item.useState == 2 ? '#F2F2F2' : 'var(--main-color-shallow)' }">
|
||||
<view class="item-base" :class="{ disabled: item.useState == 2 }">
|
||||
<image class="coupon-line" mode="heightFix"
|
||||
:src="$util.img('public/uniapp/coupon/coupon_line.png')" show-menu-by-longpress></image>
|
||||
<view>
|
||||
<view class="use_price price-font" v-if="item.type == 'reward'"
|
||||
:class="{ disabled: item.useState == 2 }">
|
||||
<text>¥</text>
|
||||
{{ parseFloat(item.money) }}
|
||||
</view>
|
||||
<view class="use_price price-font" v-else-if="item.type == 'discount'"
|
||||
:class="{ disabled: item.useState == 2 }">
|
||||
{{ parseFloat(item.discount) }}
|
||||
<text>折</text>
|
||||
</view>
|
||||
<view class="use_condition font-size-tag" v-if="item.at_least > 0"
|
||||
:class="{ disabled: item.useState == 2 }">满{{ item.at_least }}元可用</view>
|
||||
<view class="use_condition font-size-tag" v-else
|
||||
:class="{ disabled: item.useState == 2 }">无门槛优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-info">
|
||||
<view class="use_title">
|
||||
<view class="title">{{ item.coupon_name }}</view>
|
||||
<view class="max_price" v-if="item.goods_type == 2 || item.goods_type == 3"
|
||||
:class="{ disabled: item.useState == 2 }">指定商品</view>
|
||||
<view class="max_price" v-else :class="{ disabled: item.useState == 2 }">全场商品</view>
|
||||
<view class="max_price" v-if="item.discount_limit != '0.00'">
|
||||
(最大优惠{{ item.discount_limit }}元)
|
||||
</view>
|
||||
<view class="max_price" :class="{ disabled: item.useState == 2 }">{{
|
||||
item.use_channel_name }}</view>
|
||||
<!-- <view class="max_price truncate" v-if="item.use_channel!='online'" :class="{ disabled: item.useState == 2 }">
|
||||
{{ item.use_store==='all'?'适用门店:全部门店': '适用门店:'+item.use_store_name}}
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="use_time" v-if="item.validity_type == 0">
|
||||
有效期:{{ $util.timeStampTurnTime(item.end_time) }}</view>
|
||||
<view class="use_time" v-else-if="item.validity_type == 1">
|
||||
有效期:领取之日起{{ item.fixed_term }}日内有效</view>
|
||||
<view class="use_time" v-else>有效期:长期有效</view>
|
||||
</view>
|
||||
<view class="item-btn">
|
||||
<view v-if="item.useState == 0" @click.stop="receiveCoupon(item, index)">领取</view>
|
||||
<view v-if="item.useState == 1" @click.stop="toGoodsList(item, index)">去使用</view>
|
||||
<view v-if="item.receivedType == 'out'" class="disabled">已抢光</view>
|
||||
<view v-if="item.receivedType == 'expire'" class="disabled">已过期</view>
|
||||
<view v-if="item.receivedType == 'limit'" class="disabled">已达上限</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length == 0"><ns-empty text="暂无可领取的优惠券" :isIndex="false"></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
sort: 1,
|
||||
types: '',
|
||||
couponBtnSwitch: false,
|
||||
//分享建立上下级id
|
||||
mpShareData: null //小程序分享数据
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
setTimeout(() => {
|
||||
if (!this.addonIsExist.coupon) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启优惠券',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
}, 2000);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
//小程序分享接收source_member
|
||||
if (option.source_member) {
|
||||
uni.setStorageSync('source_member', option.source_member);
|
||||
}
|
||||
// 小程序扫码进入,接收source_member
|
||||
if (option.scene) {
|
||||
var sceneParams = decodeURIComponent(option.scene);
|
||||
sceneParams = sceneParams.split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
if (item.indexOf('sku_id') != -1) this.skuId = item.split('-')[1];
|
||||
if (item.indexOf('m') != -1) uni.setStorageSync('source_member', item.split('-')[1]);
|
||||
if (item.indexOf('is_test') != -1) uni.setStorageSync('is_test', 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
//记录分享关系
|
||||
if (this.storeToken && uni.getStorageSync('source_member')) {
|
||||
this.$util.onSourceMember(uni.getStorageSync('source_member'));
|
||||
}
|
||||
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare().then(res => {
|
||||
this.mpShareData = res;
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
//分享给好友
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData.appMessage;
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline() {
|
||||
return this.mpShareData.timeLine;
|
||||
},
|
||||
methods: {
|
||||
changeSort(sort, types) {
|
||||
this.list = [];
|
||||
this.sort = sort;
|
||||
this.types = types;
|
||||
this.$refs.mescroll.refresh(false);
|
||||
},
|
||||
liClick(item, index) {
|
||||
if (['limit', 'expire', 'out'].includes(item.receivedType)) return false;
|
||||
if (item.useState == 0) this.receiveCoupon(item, index);
|
||||
else this.toGoodsList(item, index);
|
||||
},
|
||||
|
||||
//领取优惠券
|
||||
receiveCoupon(item, index) {
|
||||
if (this.couponBtnSwitch) return;
|
||||
this.couponBtnSwitch = true;
|
||||
if (this.storeToken) {
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/receive',
|
||||
data: {
|
||||
coupon_type_id: item.coupon_type_id,
|
||||
get_type: 2 //获取方式:1订单2.直接领取3.活动领取
|
||||
},
|
||||
success: res => {
|
||||
this.couponBtnSwitch = false;
|
||||
let msg = '领取成功,快去使用吧';
|
||||
let list = this.list;
|
||||
if (res.code < 0) msg = res.message;
|
||||
|
||||
if (res.data.is_exist == 1) {
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].coupon_type_id == item.coupon_type_id) {
|
||||
list[i].useState = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].coupon_type_id == item.coupon_type_id) {
|
||||
list[i].receivedType = res.data.type;
|
||||
list[i].useState = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
},
|
||||
fail: res => {
|
||||
this.couponBtnSwitch = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.couponBtnSwitch = false;
|
||||
this.$refs.login.open('/pages_tool/goods/coupon');
|
||||
}
|
||||
},
|
||||
//获取优惠券列表
|
||||
getMemberCouponList(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/typepagelists',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
sort: this.sort,
|
||||
type: this.types
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
if (newArr.length) {
|
||||
newArr.forEach(v => {
|
||||
if (v.count == v.lead_count) v.useState = 2;
|
||||
else if (v.max_fetch != 0 && v.member_coupon_num && v.member_coupon_num >= v.max_fetch) v.useState = 1;
|
||||
else v.useState = 0;
|
||||
});
|
||||
}
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.list[index].logo = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
couponImageError(index) {
|
||||
this.list[index].image = this.$util.img('public/uniapp/goods/coupon.png');
|
||||
this.$forceUpdate();
|
||||
},
|
||||
toGoodsList(item) {
|
||||
if (item.goods_type != 1) {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
coupon: item.coupon_type_id
|
||||
});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_goods/list', {});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.coupon-head {
|
||||
padding: 20rpx 50rpx;
|
||||
display: flex;
|
||||
background: #fff;
|
||||
|
||||
.sort {
|
||||
border: 2rpx solid #c5c5c5;
|
||||
padding: 1rpx 20rpx;
|
||||
border-radius: $border-radius;
|
||||
cursor: pointer;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-listone {
|
||||
padding: 0 30rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
background-color: #fff2f0;
|
||||
background-size: 100% 100%;
|
||||
border-radius: 20rpx;
|
||||
align-items: stretch;
|
||||
margin-top: $padding;
|
||||
overflow: hidden;
|
||||
|
||||
.item-base {
|
||||
position: relative;
|
||||
width: 197rpx;
|
||||
min-width: 197rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(to left, var(--bg-color), var(--bg-color-shallow));
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 38rpx 10rpx 38rpx 18rpx;
|
||||
|
||||
&.disabled {
|
||||
background: #dedede;
|
||||
}
|
||||
|
||||
.coupon-line {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
>view {
|
||||
height: auto;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
|
||||
.use_price {
|
||||
font-size: 60rpx;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.use_condition {
|
||||
color: #fff;
|
||||
margin-top: $padding;
|
||||
|
||||
&.margin_top_none {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: #f8f8f8;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
height: 30rpx;
|
||||
width: 15rpx;
|
||||
border-radius: 0 30rpx 30rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.item-btn {
|
||||
width: 160rpx;
|
||||
min-width: 160rpx;
|
||||
align-self: center;
|
||||
position: relative;
|
||||
|
||||
view {
|
||||
width: 100rpx;
|
||||
height: 50rpx;
|
||||
border-radius: $border-radius;
|
||||
line-height: 50rpx;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
background-image: linear-gradient(to right, var(--bg-color), var(--bg-color-shallow));
|
||||
color: var(--btn-text-color);
|
||||
font-size: $font-size-tag;
|
||||
|
||||
&.disabled {
|
||||
background: #dedede !important;
|
||||
color: #909399 !important;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: #f8f8f8;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
height: 30rpx;
|
||||
width: 15rpx;
|
||||
border-radius: 30rpx 0 0 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-left: 20rpx;
|
||||
overflow: hidden;
|
||||
background-repeat-x: no-repeat;
|
||||
background-repeat-y: repeat;
|
||||
|
||||
.use_time {
|
||||
padding: 20rpx 0;
|
||||
border-top: 2rpx dashed #cccccc;
|
||||
font-size: $font-size-activity-tag;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.use_title {
|
||||
font-size: $font-size-base;
|
||||
font-weight: 500;
|
||||
padding: 20rpx 0;
|
||||
|
||||
// height:80rpx;
|
||||
.title {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.max_price {
|
||||
font-weight: 400;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin-top: 200rpx;
|
||||
}
|
||||
|
||||
.cf-container {
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.tab {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 86rpx;
|
||||
|
||||
>view {
|
||||
text-align: center;
|
||||
width: 33%;
|
||||
height: 86rpx;
|
||||
|
||||
text {
|
||||
display: inline-block;
|
||||
line-height: 86rpx;
|
||||
height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
border-bottom: 4rpx solid;
|
||||
}
|
||||
|
||||
.truncate {
|
||||
overflow: hidden;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="cf-container color-line-border">
|
||||
<view class="tab">
|
||||
<view @click="changeSort(1)"><text
|
||||
:class="sort == 1 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang("diy.diy-category-item.l47.t0") }}</text></view>
|
||||
<view @click="changeSort(2, 'reward')"><text
|
||||
:class="sort == 2 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang("tool.goods.coupon.l8.t0") }}</text></view>
|
||||
<view @click="changeSort(3, 'discount')"><text
|
||||
:class="sort == 3 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang("tool.goods.coupon.l10.t0") }}</text></view>
|
||||
<!-- <view @click="changeSort(4, 'no_threshold')"><text :class="sort == 4 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang("tool.goods.coupon.l11.t0") }}</text></view> -->
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<mescroll-uni ref="mescroll" top="100" @getData="getMemberCouponList" :style="tabBarPagePaddingStyle">
|
||||
<block slot="list">
|
||||
<view class="coupon-listone">
|
||||
<view class="item" v-for="(item, index) in list" :key="index" @click="liClick(item, index)"
|
||||
:style="{ backgroundColor: item.useState == 2 ? '#F2F2F2' : 'var(--main-color-shallow)' }">
|
||||
<view class="item-base" :class="{ disabled: item.useState == 2 }">
|
||||
<image class="coupon-line" mode="heightFix"
|
||||
:src="$util.img('public/uniapp/coupon/coupon_line.png')" show-menu-by-longpress></image>
|
||||
<view>
|
||||
<view class="use_price price-font" v-if="item.type == 'reward'"
|
||||
:class="{ disabled: item.useState == 2 }">
|
||||
<text>¥</text>
|
||||
{{ parseFloat(item.money) }}
|
||||
</view>
|
||||
<view class="use_price price-font" v-else-if="item.type == 'discount'"
|
||||
:class="{ disabled: item.useState == 2 }">
|
||||
{{ parseFloat(item.discount) }}
|
||||
<text>{{ $lang("common.register-reward.l60.t1") }}</text>
|
||||
</view>
|
||||
<view class="use_condition font-size-tag" v-if="item.at_least > 0"
|
||||
:class="{ disabled: item.useState == 2 }">{ $lang("diy.diy-coupon.l32.t0") } item.at_least }}元可用</view>
|
||||
<view class="use_condition font-size-tag" v-else
|
||||
:class="{ disabled: item.useState == 2 }">{{ $lang("diy.diy-coupon.l32.t2") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-info">
|
||||
<view class="use_title">
|
||||
<view class="title">{{ item.coupon_name }}</view>
|
||||
<view class="max_price" v-if="item.goods_type == 2 || item.goods_type == 3"
|
||||
:class="{ disabled: item.useState == 2 }">{{ $lang("tool.goods.coupon.l44.t0") }}</view>
|
||||
<view class="max_price" v-else :class="{ disabled: item.useState == 2 }">{{ $lang("tool.goods.coupon.l45.t0") }}</view>
|
||||
<view class="max_price" v-if="item.discount_limit != '0.00'">
|
||||
(最大优惠{{ item.discount_limit }}元)
|
||||
</view>
|
||||
<view class="max_price" :class="{ disabled: item.useState == 2 }">{{
|
||||
item.use_channel_name }}</view>
|
||||
<!-- <view class="max_price truncate" v-if="item.use_channel!='online'" :class="{ disabled: item.useState == 2 }">
|
||||
{{ item.use_store==='all'?'适用门店:全部门店': $lang('tool.goods.coupon.l52.t1')+item.use_store_name}}
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="use_time" v-if="item.validity_type == 0">
|
||||
有效期:{{ $util.timeStampTurnTime(item.end_time) }}</view>
|
||||
<view class="use_time" v-else-if="item.validity_type == 1">
|
||||
有效期:领取之日起{{ item.fixed_term }}日内有效</view>
|
||||
<view class="use_time" v-else>{{ $lang("goods.cart.l294") }}</view>
|
||||
</view>
|
||||
<view class="item-btn">
|
||||
<view v-if="item.useState == 0" @click.stop="receiveCoupon(item, index)">{{ $lang("diy.diy-coupon.l71.t0") }}</view>
|
||||
<view v-if="item.useState == 1" @click.stop="toGoodsList(item, index)">{{ $lang("diy.diy-coupon.l38.t0") }}</view>
|
||||
<view v-if="item.receivedType == 'out'" class="disabled">{{ $lang("goods.detail.l354") }}</view>
|
||||
<view v-if="item.receivedType == 'expire'" class="disabled">{{ $lang("tool.goods.coupon.l65.t0") }}</view>
|
||||
<view v-if="item.receivedType == 'limit'" class="disabled">{{ $lang("tool.goods.coupon.l66.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="list.length == 0"><ns-empty text="暂无可领取的优惠券" :isIndex="false"></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
list: [],
|
||||
sort: 1,
|
||||
types: '',
|
||||
couponBtnSwitch: false,
|
||||
//分享建立上下级id
|
||||
mpShareData: null //小程序分享数据
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
setTimeout(() => {
|
||||
if (!this.addonIsExist.coupon) {
|
||||
this.$util.showToast({
|
||||
title: $lang('tool.goods.coupon.l102.t0'),
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
}, 2000);
|
||||
}
|
||||
}, 1000);
|
||||
|
||||
//小程序分享接收source_member
|
||||
if (option.source_member) {
|
||||
uni.setStorageSync('source_member', option.source_member);
|
||||
}
|
||||
// 小程序扫码进入,接收source_member
|
||||
if (option.scene) {
|
||||
var sceneParams = decodeURIComponent(option.scene);
|
||||
sceneParams = sceneParams.split('&');
|
||||
if (sceneParams.length) {
|
||||
sceneParams.forEach(item => {
|
||||
if (item.indexOf('sku_id') != -1) this.skuId = item.split('-')[1];
|
||||
if (item.indexOf('m') != -1) uni.setStorageSync('source_member', item.split('-')[1]);
|
||||
if (item.indexOf('is_test') != -1) uni.setStorageSync('is_test', 1);
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
//记录分享关系
|
||||
if (this.storeToken && uni.getStorageSync('source_member')) {
|
||||
this.$util.onSourceMember(uni.getStorageSync('source_member'));
|
||||
}
|
||||
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare().then(res => {
|
||||
this.mpShareData = res;
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
//分享给好友
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData.appMessage;
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline() {
|
||||
return this.mpShareData.timeLine;
|
||||
},
|
||||
methods: {
|
||||
changeSort(sort, types) {
|
||||
this.list = [];
|
||||
this.sort = sort;
|
||||
this.types = types;
|
||||
this.$refs.mescroll.refresh(false);
|
||||
},
|
||||
liClick(item, index) {
|
||||
if (['limit', 'expire', 'out'].includes(item.receivedType)) return false;
|
||||
if (item.useState == 0) this.receiveCoupon(item, index);
|
||||
else this.toGoodsList(item, index);
|
||||
},
|
||||
|
||||
//领取优惠券
|
||||
receiveCoupon(item, index) {
|
||||
if (this.couponBtnSwitch) return;
|
||||
this.couponBtnSwitch = true;
|
||||
if (this.storeToken) {
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/receive',
|
||||
data: {
|
||||
coupon_type_id: item.coupon_type_id,
|
||||
get_type: 2 //获取方式:1订单2.直接领取3.活动领取
|
||||
},
|
||||
success: res => {
|
||||
this.couponBtnSwitch = false;
|
||||
let msg = $lang('goods.public.js.detail.l323');
|
||||
let list = this.list;
|
||||
if (res.code < 0) msg = res.message;
|
||||
|
||||
if (res.data.is_exist == 1) {
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].coupon_type_id == item.coupon_type_id) {
|
||||
list[i].useState = 1;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
if (list[i].coupon_type_id == item.coupon_type_id) {
|
||||
list[i].receivedType = res.data.type;
|
||||
list[i].useState = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
},
|
||||
fail: res => {
|
||||
this.couponBtnSwitch = false;
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.couponBtnSwitch = false;
|
||||
this.$refs.login.open('/pages_tool/goods/coupon');
|
||||
}
|
||||
},
|
||||
//获取优惠券列表
|
||||
getMemberCouponList(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/typepagelists',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
sort: this.sort,
|
||||
type: this.types
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
if (newArr.length) {
|
||||
newArr.forEach(v => {
|
||||
if (v.count == v.lead_count) v.useState = 2;
|
||||
else if (v.max_fetch != 0 && v.member_coupon_num && v.member_coupon_num >= v.max_fetch) v.useState = 1;
|
||||
else v.useState = 0;
|
||||
});
|
||||
}
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.list = []; //如果是第一页需手动制空列表
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.list[index].logo = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
couponImageError(index) {
|
||||
this.list[index].image = this.$util.img('public/uniapp/goods/coupon.png');
|
||||
this.$forceUpdate();
|
||||
},
|
||||
toGoodsList(item) {
|
||||
if (item.goods_type != 1) {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
coupon: item.coupon_type_id
|
||||
});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_goods/list', {});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.coupon-head {
|
||||
padding: 20rpx 50rpx;
|
||||
display: flex;
|
||||
background: #fff;
|
||||
|
||||
.sort {
|
||||
border: 2rpx solid #c5c5c5;
|
||||
padding: 1rpx 20rpx;
|
||||
border-radius: $border-radius;
|
||||
cursor: pointer;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-listone {
|
||||
padding: 0 30rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
background-color: #fff2f0;
|
||||
background-size: 100% 100%;
|
||||
border-radius: 20rpx;
|
||||
align-items: stretch;
|
||||
margin-top: $padding;
|
||||
overflow: hidden;
|
||||
|
||||
.item-base {
|
||||
position: relative;
|
||||
width: 197rpx;
|
||||
min-width: 197rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(to left, var(--bg-color), var(--bg-color-shallow));
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 38rpx 10rpx 38rpx 18rpx;
|
||||
|
||||
&.disabled {
|
||||
background: #dedede;
|
||||
}
|
||||
|
||||
.coupon-line {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
>view {
|
||||
height: auto;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
|
||||
.use_price {
|
||||
font-size: 60rpx;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.use_condition {
|
||||
color: #fff;
|
||||
margin-top: $padding;
|
||||
|
||||
&.margin_top_none {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: #f8f8f8;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
height: 30rpx;
|
||||
width: 15rpx;
|
||||
border-radius: 0 30rpx 30rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.item-btn {
|
||||
width: 160rpx;
|
||||
min-width: 160rpx;
|
||||
align-self: center;
|
||||
position: relative;
|
||||
|
||||
view {
|
||||
width: 100rpx;
|
||||
height: 50rpx;
|
||||
border-radius: $border-radius;
|
||||
line-height: 50rpx;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
background-image: linear-gradient(to right, var(--bg-color), var(--bg-color-shallow));
|
||||
color: var(--btn-text-color);
|
||||
font-size: $font-size-tag;
|
||||
|
||||
&.disabled {
|
||||
background: #dedede !important;
|
||||
color: #909399 !important;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: #f8f8f8;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
height: 30rpx;
|
||||
width: 15rpx;
|
||||
border-radius: 30rpx 0 0 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-left: 20rpx;
|
||||
overflow: hidden;
|
||||
background-repeat-x: no-repeat;
|
||||
background-repeat-y: repeat;
|
||||
|
||||
.use_time {
|
||||
padding: 20rpx 0;
|
||||
border-top: 2rpx dashed #cccccc;
|
||||
font-size: $font-size-activity-tag;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.use_title {
|
||||
font-size: $font-size-base;
|
||||
font-weight: 500;
|
||||
padding: 20rpx 0;
|
||||
|
||||
// height:80rpx;
|
||||
.title {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.max_price {
|
||||
font-weight: 400;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
margin-top: 200rpx;
|
||||
}
|
||||
|
||||
.cf-container {
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.tab {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 86rpx;
|
||||
|
||||
>view {
|
||||
text-align: center;
|
||||
width: 33%;
|
||||
height: 86rpx;
|
||||
|
||||
text {
|
||||
display: inline-block;
|
||||
line-height: 86rpx;
|
||||
height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.active {
|
||||
border-bottom: 4rpx solid;
|
||||
}
|
||||
|
||||
.truncate {
|
||||
overflow: hidden;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
File diff suppressed because one or more lines are too long
@@ -44,12 +44,12 @@
|
||||
</scroll-view>
|
||||
|
||||
<view v-if="item.explain_first != ''" class="time shop-reply-box">
|
||||
<view class="shop-reply">商家回复:</view>
|
||||
<view class="shop-reply">{{ $lang("tool.goods.evaluate.l47.t0") }}</view>
|
||||
<view class="cont">{{ item.explain_first }}</view>
|
||||
</view>
|
||||
|
||||
<template v-if="item.again_content != '' && item.again_is_audit == 1">
|
||||
<view class="review-evaluation color-base-text">追加评价</view>
|
||||
<view class="review-evaluation color-base-text">{{ $lang("tool.goods.evaluate.l52.t0") }}</view>
|
||||
<view class="cont">{{ item.again_content }}</view>
|
||||
<scroll-view scroll-x="true">
|
||||
<view class="evaluate-img" v-if="item.again_images.length > 0">
|
||||
@@ -61,12 +61,12 @@
|
||||
</scroll-view>
|
||||
|
||||
<view v-if="item.again_explain != ''" class="time shop-reply-box">
|
||||
<view class="shop-reply" v-if="item.again_explain != ''">商家回复:</view>
|
||||
<view class="shop-reply" v-if="item.again_explain != ''">{{ $lang("tool.goods.evaluate.l47.t0") }}</view>
|
||||
<view class="cont">{{ item.again_explain }}</view>
|
||||
</view>
|
||||
</template>
|
||||
</view>
|
||||
<view v-if="list.length == 0"><ns-empty text="暂无商品评价"></ns-empty></view>
|
||||
<view v-if="list.length == 0"><ns-empty text=$lang("tool.goods.evaluate.l69.t0")></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
@@ -79,7 +79,7 @@ export default {
|
||||
return {
|
||||
goodsId: 0,
|
||||
list: [],
|
||||
evaluateList: [{ name: '全部', value: 0, count: 0 }, { name: '好评', value: 1, count: 0 }, { name: '中评', value: 2, count: 0 }, { name: '差评', value: 3, count: 0 }],
|
||||
evaluateList: [{ name: $lang('diy.diy-category-item.l47.t0'), value: 0, count: 0 }, { name: $lang('tool.goods.evaluate.l82.t0'), value: 1, count: 0 }, { name: $lang('tool.goods.evaluate.l82.t1'), value: 2, count: 0 }, { name: $lang('tool.goods.evaluate.l82.t2'), value: 3, count: 0 }],
|
||||
evaluateTab: 0,
|
||||
mescroll_type: {}
|
||||
};
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<view class="page" :style="themeColor">
|
||||
<view class="closeBox">
|
||||
<image :src="$util.img('public/uniapp/goods/not_exist.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<text class="close-title">您查看的商品不存在,可能已下架或被删除</text>
|
||||
<text class="close-title">{{ $lang("tool.goods.not_exist.l5.t0") }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -1,345 +1,345 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="content" :style="tabBarPagePaddingStyle">
|
||||
<view class="cate-search">
|
||||
<view class="search-box" @click="search()" @tap.stop="search()">
|
||||
<input class="uni-input" maxlength="50" v-model="inputValue" confirm-type="search" @focus="inputFocus" focus @confirm="search()" @click="search()" @tap="search()" :placeholder="searchWords ? searchWords : ''" />
|
||||
<text class="iconfont icon-sousuo3" @click="search()"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-content">
|
||||
<!-- 历史搜索 -->
|
||||
<view class="history" v-if="historyList.length">
|
||||
<view class="history-box">
|
||||
<view class="history-top">
|
||||
<view class="title">历史搜索</view>
|
||||
<view class="icon iconfont icon-icon7" @click="deleteHistoryList"></view>
|
||||
</view>
|
||||
<view class="history-bottom " id="history-list" :style="{ maxHeight: !isAllHistory ? '100%' : '168rpx' }">
|
||||
<view class="history-li" v-for="(item, index) in historyList" :key="index" @click="otherSearch(item)">
|
||||
<view>{{ item }}</view>
|
||||
</view>
|
||||
<view class="history-li history_more" v-if="isAllHistory" @click="isAllHistory = false">
|
||||
<view><text class="iconfont icon-iconangledown"></text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 热门搜索 -->
|
||||
<view class="history" v-if="hotList.length">
|
||||
<view class="history-box">
|
||||
<view class="history-top">
|
||||
<view class="title">热门搜索</view>
|
||||
</view>
|
||||
<view class="history-bottom">
|
||||
<view class="history-li" v-for="(item, index) in hotList" :key="index" @click="otherSearch(item)" @longtap="deleteItem(item)">
|
||||
<view>{{ item }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
inputValue: '', //搜索框的值
|
||||
historyList: [], //历史搜索记录
|
||||
searchList: [], //搜索发现列表
|
||||
alikeList: [],
|
||||
isIndex: false,
|
||||
searchWords: '',
|
||||
hotList: [],
|
||||
isAllHistory: false
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.keyword) this.inputValue = options.keyword;
|
||||
uni.getStorageSync('search') ? '' : uni.setStorageSync('search', []);
|
||||
},
|
||||
onShow() {
|
||||
this.findHistoryList();
|
||||
this.defaultSearch();
|
||||
this.findHotList();
|
||||
this.$nextTick(function() {
|
||||
this.getHistoryHeight();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//获取历史搜索记录
|
||||
findHistoryList() {
|
||||
this.historyList = uni.getStorageSync('search').reverse();
|
||||
},
|
||||
//删除所有历史记录
|
||||
deleteHistoryList() {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除全部历史记录?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('search', []);
|
||||
this.findHistoryList();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除历史记录的某一项
|
||||
deleteItem(e) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '确认删除该条历史记录?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
let array = uni.getStorageSync('search');
|
||||
let newArr = array.filter(v => {
|
||||
return v != e;
|
||||
});
|
||||
uni.setStorageSync('search', newArr);
|
||||
this.findHistoryList();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取默认搜素
|
||||
defaultSearch() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goods/defaultSearchWords',
|
||||
success: res => {
|
||||
this.searchWords = res.data.words;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取热门搜素
|
||||
findHotList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goods/hotSearchWords',
|
||||
success: res => {
|
||||
if (res.data.words != '') {
|
||||
this.hotList = res.data.words.split(',');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//input框获取焦点事件
|
||||
inputFocus(e) {
|
||||
if (this.inputValue.trim() != '') this.dataList = [];
|
||||
},
|
||||
//点击其他列表搜索
|
||||
otherSearch(e) {
|
||||
this.inputValue = e;
|
||||
this.search();
|
||||
},
|
||||
//搜索
|
||||
search() {
|
||||
|
||||
if (this.inputValue.trim() != '') {
|
||||
|
||||
// 对历史搜索处理,判断有无,最近搜索显示在最前
|
||||
let historyList = uni.getStorageSync('search');
|
||||
let array = [];
|
||||
if (historyList.length) {
|
||||
array = historyList.filter(v => {
|
||||
return v != this.inputValue.trim();
|
||||
});
|
||||
array.push(this.inputValue.trim());
|
||||
} else {
|
||||
array.push(this.inputValue.trim());
|
||||
}
|
||||
uni.setStorageSync('search', array);
|
||||
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
keyword: this.inputValue.trim()
|
||||
});
|
||||
} else {
|
||||
if (this.searchWords == '') {
|
||||
this.$util.showToast({
|
||||
title: '搜索内容不能为空哦'
|
||||
});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
//keyword: this.searchWords
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取元素高度
|
||||
getHistoryHeight() {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('#history-list')
|
||||
.boundingClientRect(data => {
|
||||
if (data && data.height > uni.upx2px(70) * 2 + uni.upx2px(35) * 2) {
|
||||
this.isAllHistory = true;
|
||||
}
|
||||
}).exec();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
::v-deep .empty {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
.cart-empty {
|
||||
padding-top: 54px;
|
||||
}
|
||||
|
||||
.content {
|
||||
// overflow: hidden;
|
||||
width: 100vw;
|
||||
/* #ifdef MP */
|
||||
height: 100vh;
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - env(safe-area-inset-bottom) - var(--status-bar-height));
|
||||
/* #endif */
|
||||
/* #ifdef APP-PLUS */
|
||||
height: calc(100vh - 44px - env(safe-area-inset-bottom));
|
||||
/* #endif */
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.cate-search {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
padding: 10rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
/* #ifdef H5 */
|
||||
padding-top: 30rpx;
|
||||
/* #endif */
|
||||
|
||||
input {
|
||||
font-size: $font-size-base;
|
||||
height: 100%;
|
||||
padding: 0 25rpx 0 30rpx;
|
||||
width: calc(100% - 120rpx);
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 32rpx;
|
||||
color: $color-tip;
|
||||
width: 120rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
width: 100%;
|
||||
height: 64rpx;
|
||||
background: $color-bg;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.search-content {
|
||||
box-sizing: border-box;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.history {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.history-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
padding: 30rpx 30rpx 0rpx 30rpx;
|
||||
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
|
||||
.history-top {
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: $font-size-toolbar;
|
||||
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
color: $color-tip;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
|
||||
.history-bottom {
|
||||
width: 100%;
|
||||
padding-top: $padding;
|
||||
position: relative;
|
||||
|
||||
.history-li {
|
||||
display: inline-block;
|
||||
margin-right: 20rpx;
|
||||
margin-bottom: 15rpx;
|
||||
max-width: 100%;
|
||||
|
||||
view {
|
||||
line-height: 66rpx;
|
||||
background: #f8f8f8 !important;
|
||||
height: 66rpx;
|
||||
color: #303133 !important;
|
||||
margin: 0 0rpx 4rpx 0 !important;
|
||||
padding: 0 $padding;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
&.history_more {
|
||||
margin-right: 0;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hidden-show {
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
text-align: center;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.search-alike {
|
||||
width: 100%;
|
||||
height: calc(100vh - 100rpx);
|
||||
|
||||
padding: 0 $padding;
|
||||
box-sizing: border-box;
|
||||
|
||||
.alike-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: $padding;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="content" :style="tabBarPagePaddingStyle">
|
||||
<view class="cate-search">
|
||||
<view class="search-box" @click="search()" @tap.stop="search()">
|
||||
<input class="uni-input" maxlength="50" v-model="inputValue" confirm-type="search" @focus="inputFocus" focus @confirm="search()" @click="search()" @tap="search()" :placeholder="searchWords ? searchWords : ''" />
|
||||
<text class="iconfont icon-sousuo3" @click="search()"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-content">
|
||||
<!-- 历史搜索 -->
|
||||
<view class="history" v-if="historyList.length">
|
||||
<view class="history-box">
|
||||
<view class="history-top">
|
||||
<view class="title">{{ $lang("tool.goods.search.l15.t0") }}</view>
|
||||
<view class="icon iconfont icon-icon7" @click="deleteHistoryList"></view>
|
||||
</view>
|
||||
<view class="history-bottom " id="history-list" :style="{ maxHeight: !isAllHistory ? '100%' : '168rpx' }">
|
||||
<view class="history-li" v-for="(item, index) in historyList" :key="index" @click="otherSearch(item)">
|
||||
<view>{{ item }}</view>
|
||||
</view>
|
||||
<view class="history-li history_more" v-if="isAllHistory" @click="isAllHistory = false">
|
||||
<view><text class="iconfont icon-iconangledown"></text></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 热门搜索 -->
|
||||
<view class="history" v-if="hotList.length">
|
||||
<view class="history-box">
|
||||
<view class="history-top">
|
||||
<view class="title">{{ $lang("tool.goods.search.l33.t0") }}</view>
|
||||
</view>
|
||||
<view class="history-bottom">
|
||||
<view class="history-li" v-for="(item, index) in hotList" :key="index" @click="otherSearch(item)" @longtap="deleteItem(item)">
|
||||
<view>{{ item }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
inputValue: '', //搜索框的值
|
||||
historyList: [], //历史搜索记录
|
||||
searchList: [], //搜索发现列表
|
||||
alikeList: [],
|
||||
isIndex: false,
|
||||
searchWords: '',
|
||||
hotList: [],
|
||||
isAllHistory: false
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.keyword) this.inputValue = options.keyword;
|
||||
uni.getStorageSync('search') ? '' : uni.setStorageSync('search', []);
|
||||
},
|
||||
onShow() {
|
||||
this.findHistoryList();
|
||||
this.defaultSearch();
|
||||
this.findHotList();
|
||||
this.$nextTick(function() {
|
||||
this.getHistoryHeight();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
//获取历史搜索记录
|
||||
findHistoryList() {
|
||||
this.historyList = uni.getStorageSync('search').reverse();
|
||||
},
|
||||
//删除所有历史记录
|
||||
deleteHistoryList() {
|
||||
uni.showModal({
|
||||
title: $lang('common.wxwork-contact.l202.t0'),
|
||||
content: $lang('tool.goods.search.l86.t0'),
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync('search', []);
|
||||
this.findHistoryList();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除历史记录的某一项
|
||||
deleteItem(e) {
|
||||
uni.showModal({
|
||||
title: $lang('common.wxwork-contact.l202.t0'),
|
||||
content: $lang('tool.goods.search.l99.t0'),
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
let array = uni.getStorageSync('search');
|
||||
let newArr = array.filter(v => {
|
||||
return v != e;
|
||||
});
|
||||
uni.setStorageSync('search', newArr);
|
||||
this.findHistoryList();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取默认搜素
|
||||
defaultSearch() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goods/defaultSearchWords',
|
||||
success: res => {
|
||||
this.searchWords = res.data.words;
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取热门搜素
|
||||
findHotList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goods/hotSearchWords',
|
||||
success: res => {
|
||||
if (res.data.words != '') {
|
||||
this.hotList = res.data.words.split(',');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//input框获取焦点事件
|
||||
inputFocus(e) {
|
||||
if (this.inputValue.trim() != '') this.dataList = [];
|
||||
},
|
||||
//点击其他列表搜索
|
||||
otherSearch(e) {
|
||||
this.inputValue = e;
|
||||
this.search();
|
||||
},
|
||||
//搜索
|
||||
search() {
|
||||
|
||||
if (this.inputValue.trim() != '') {
|
||||
|
||||
// 对历史搜索处理,判断有无,最近搜索显示在最前
|
||||
let historyList = uni.getStorageSync('search');
|
||||
let array = [];
|
||||
if (historyList.length) {
|
||||
array = historyList.filter(v => {
|
||||
return v != this.inputValue.trim();
|
||||
});
|
||||
array.push(this.inputValue.trim());
|
||||
} else {
|
||||
array.push(this.inputValue.trim());
|
||||
}
|
||||
uni.setStorageSync('search', array);
|
||||
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
keyword: this.inputValue.trim()
|
||||
});
|
||||
} else {
|
||||
if (this.searchWords == '') {
|
||||
this.$util.showToast({
|
||||
title: $lang('tool.goods.search.l165.t0')
|
||||
});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
//keyword: this.searchWords
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
// 获取元素高度
|
||||
getHistoryHeight() {
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('#history-list')
|
||||
.boundingClientRect(data => {
|
||||
if (data && data.height > uni.upx2px(70) * 2 + uni.upx2px(35) * 2) {
|
||||
this.isAllHistory = true;
|
||||
}
|
||||
}).exec();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
::v-deep .empty {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
.cart-empty {
|
||||
padding-top: 54px;
|
||||
}
|
||||
|
||||
.content {
|
||||
// overflow: hidden;
|
||||
width: 100vw;
|
||||
/* #ifdef MP */
|
||||
height: 100vh;
|
||||
/* #endif */
|
||||
/* #ifdef H5 */
|
||||
height: calc(100vh - env(safe-area-inset-bottom) - var(--status-bar-height));
|
||||
/* #endif */
|
||||
/* #ifdef APP-PLUS */
|
||||
height: calc(100vh - 44px - env(safe-area-inset-bottom));
|
||||
/* #endif */
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.cate-search {
|
||||
width: 100%;
|
||||
background: #ffffff;
|
||||
padding: 10rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
/* #ifdef H5 */
|
||||
padding-top: 30rpx;
|
||||
/* #endif */
|
||||
|
||||
input {
|
||||
font-size: $font-size-base;
|
||||
height: 100%;
|
||||
padding: 0 25rpx 0 30rpx;
|
||||
width: calc(100% - 120rpx);
|
||||
}
|
||||
|
||||
text {
|
||||
font-size: 32rpx;
|
||||
color: $color-tip;
|
||||
width: 120rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
width: 100%;
|
||||
height: 64rpx;
|
||||
background: $color-bg;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.search-content {
|
||||
box-sizing: border-box;
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.history {
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
|
||||
.history-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
padding: 30rpx 30rpx 0rpx 30rpx;
|
||||
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
|
||||
.history-top {
|
||||
width: 100%;
|
||||
height: 60rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
font-size: $font-size-toolbar;
|
||||
|
||||
.title {
|
||||
font-weight: 500;
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
color: $color-tip;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
|
||||
.history-bottom {
|
||||
width: 100%;
|
||||
padding-top: $padding;
|
||||
position: relative;
|
||||
|
||||
.history-li {
|
||||
display: inline-block;
|
||||
margin-right: 20rpx;
|
||||
margin-bottom: 15rpx;
|
||||
max-width: 100%;
|
||||
|
||||
view {
|
||||
line-height: 66rpx;
|
||||
background: #f8f8f8 !important;
|
||||
height: 66rpx;
|
||||
color: #303133 !important;
|
||||
margin: 0 0rpx 4rpx 0 !important;
|
||||
padding: 0 $padding;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
border-radius: 20rpx;
|
||||
}
|
||||
|
||||
&.history_more {
|
||||
margin-right: 0;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.hidden-show {
|
||||
width: 100%;
|
||||
height: 70rpx;
|
||||
text-align: center;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.search-alike {
|
||||
width: 100%;
|
||||
height: calc(100vh - 100rpx);
|
||||
|
||||
padding: 0 $padding;
|
||||
box-sizing: border-box;
|
||||
|
||||
.alike-box {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: #ffffff;
|
||||
border-radius: $padding;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,132 +1,132 @@
|
||||
<template>
|
||||
<view class="help" :style="themeColor">
|
||||
<block v-if="dataList.length">
|
||||
<view class="help-item" v-for="(item, index) in dataList" :key="index">
|
||||
<view :class="['item-title', item.child_list.length == 0 ? 'empty' : '']">{{ item.class_name }}</view>
|
||||
<view class="item-content" v-for="(s_item, s_index) in item.child_list" :key="s_index" @click="helpDetail(s_item)">{{ s_item.title }}</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else><ns-empty text="暂无帮助信息" :isIndex="false"></ns-empty></block>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
this.setPublicShare();
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/helpclass/lists',
|
||||
data: {},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.dataList = res.data;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
helpDetail(e) {
|
||||
// #ifndef MP-WEIXIN
|
||||
if (e.link_address) {
|
||||
uni.redirectTo({
|
||||
url: '/pages_tool/webview/webview?src=' + encodeURIComponent(e.link_address)
|
||||
});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/help/detail', {
|
||||
id: e.id
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.redirectTo('/pages_tool/help/detail', {
|
||||
id: e.id
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
// 设置公众号分享
|
||||
setPublicShare() {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/help/list';
|
||||
this.$util.setPublicShare({
|
||||
title: '帮助中心',
|
||||
desc: '',
|
||||
link: shareUrl,
|
||||
imgUrl: this.siteInfo ? this.$util.img(this.siteInfo.logo_square) : ''
|
||||
});
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var title = '帮助中心使你更加方便';
|
||||
var path = '/pages_tool/help/list';
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => {},
|
||||
fail: res => {}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.help {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-top: 20rpx;
|
||||
|
||||
.help-item {
|
||||
width: calc(100% - 60rpx);
|
||||
margin: 0 auto;
|
||||
padding: 32rpx 35rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
margin-bottom: 18rpx;
|
||||
border-radius: 10rpx;
|
||||
|
||||
.item-title {
|
||||
padding-bottom: 15rpx;
|
||||
font-size: 30rpx;
|
||||
color: #000;
|
||||
border-bottom: 2rpx solid #f1f1f1;
|
||||
&.empty {
|
||||
padding-bottom: 0;
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.item-content {
|
||||
padding: 24rpx 0;
|
||||
border-bottom: 2rpx solid #f1f1f1;
|
||||
font-size: $font-size-base;
|
||||
color: $color-sub;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="help" :style="themeColor">
|
||||
<block v-if="dataList.length">
|
||||
<view class="help-item" v-for="(item, index) in dataList" :key="index">
|
||||
<view :class="['item-title', item.child_list.length == 0 ? 'empty' : '']">{{ item.class_name }}</view>
|
||||
<view class="item-content" v-for="(s_item, s_index) in item.child_list" :key="s_index" @click="helpDetail(s_item)">{{ s_item.title }}</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else><ns-empty text="暂无帮助信息" :isIndex="false"></ns-empty></block>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
onLoad() {},
|
||||
onShow() {
|
||||
this.setPublicShare();
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/helpclass/lists',
|
||||
data: {},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.dataList = res.data;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
helpDetail(e) {
|
||||
// #ifndef MP-WEIXIN
|
||||
if (e.link_address) {
|
||||
uni.redirectTo({
|
||||
url: '/pages_tool/webview/webview?src=' + encodeURIComponent(e.link_address)
|
||||
});
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/help/detail', {
|
||||
id: e.id
|
||||
});
|
||||
}
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.redirectTo('/pages_tool/help/detail', {
|
||||
id: e.id
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
// 设置公众号分享
|
||||
setPublicShare() {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/help/list';
|
||||
this.$util.setPublicShare({
|
||||
title: $lang('help.list.l73'),
|
||||
desc: '',
|
||||
link: shareUrl,
|
||||
imgUrl: this.siteInfo ? this.$util.img(this.siteInfo.logo_square) : ''
|
||||
});
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var title = $lang('help.list.l81');
|
||||
var path = '/pages_tool/help/list';
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => {},
|
||||
fail: res => {}
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.help {
|
||||
height: 100%;
|
||||
box-sizing: border-box;
|
||||
padding-top: 20rpx;
|
||||
|
||||
.help-item {
|
||||
width: calc(100% - 60rpx);
|
||||
margin: 0 auto;
|
||||
padding: 32rpx 35rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
margin-bottom: 18rpx;
|
||||
border-radius: 10rpx;
|
||||
|
||||
.item-title {
|
||||
padding-bottom: 15rpx;
|
||||
font-size: 30rpx;
|
||||
color: #000;
|
||||
border-bottom: 2rpx solid #f1f1f1;
|
||||
&.empty {
|
||||
padding-bottom: 0;
|
||||
border-bottom: none;
|
||||
}
|
||||
}
|
||||
|
||||
.item-content {
|
||||
padding: 24rpx 0;
|
||||
border-bottom: 2rpx solid #f1f1f1;
|
||||
font-size: $font-size-base;
|
||||
color: $color-sub;
|
||||
|
||||
&:last-child {
|
||||
border-bottom: none;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<view v-if="showTip" class="collectPopupWindow"
|
||||
:style="{ marginTop: (collectTop + statusBarHeight) * 2 + 'rpx' }">
|
||||
<image :src="$util.img('public/uniapp/index/collect2.png')" mode="aspectFit" show-menu-by-longpress/>
|
||||
<text @click="closeCollectPopupWindow">我知道了</text>
|
||||
<text @click="closeCollectPopupWindow">{{ $lang("diy.diy-notice.l49.t0") }}</text>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
|
||||
@@ -1,440 +1,440 @@
|
||||
<template>
|
||||
<view class="find" :style="themeColor">
|
||||
<view class="iconfont icon-close" @click="navigateBack()"></view>
|
||||
<view class="header-wrap">
|
||||
<block v-if="stepShow == 0">
|
||||
<view class="title">请输入手机号</view>
|
||||
<view><text class="color-tip">请确认您的账号已绑定此手机号</text></view>
|
||||
</block>
|
||||
|
||||
<block v-if="stepShow == 1">
|
||||
<view class="title">请输入验证码</view>
|
||||
<view>
|
||||
<text class="color-tip">已将验证码发送至手机号:{{ formData.mobile }}</text>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<block v-if="stepShow == 2">
|
||||
<view class="title">请设置新的密码</view>
|
||||
<view><text class="color-tip">建议您的新密码以简单好记为标准</text></view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="find-form">
|
||||
<!-- 输入手机号和验证码 -->
|
||||
<block v-if="stepShow == 0">
|
||||
<view class="form-input">
|
||||
<input
|
||||
class="uni-input"
|
||||
placeholder-class="placeholder-class"
|
||||
type="text"
|
||||
maxlength="17"
|
||||
v-model="formData.mobile"
|
||||
:placeholder="$lang('accountPlaceholder')"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="form-input align-type">
|
||||
<input
|
||||
class="uni-input info-content"
|
||||
placeholder-class="placeholder-class"
|
||||
type="number"
|
||||
maxlength="4"
|
||||
:placeholder="$lang('captchaPlaceholder')"
|
||||
v-model="formData.captcha"
|
||||
/>
|
||||
<image :src="captcha.img" class="captcha" @click="getCaptcha" show-menu-by-longpress></image>
|
||||
</view>
|
||||
|
||||
<button type="primary" class="find-btn" @click="nextStep()">{{ $lang('next') }}</button>
|
||||
</block>
|
||||
|
||||
<!-- 输入动态码 -->
|
||||
<block v-if="stepShow == 1">
|
||||
<myp-one :maxlength="4" @input="input" ref="input" :auto-focus="true"></myp-one>
|
||||
<button type="primary" class="find-btn" :disabled="isSend" @click="sendDynaCode">{{ codeText }}</button>
|
||||
</block>
|
||||
<!-- 输入新密码 -->
|
||||
<block v-if="stepShow == 2">
|
||||
<view class="form-input">
|
||||
<input
|
||||
class="uni-input"
|
||||
placeholder-class="placeholder-class"
|
||||
type="text"
|
||||
maxlength="30"
|
||||
password="true"
|
||||
:placeholder="$lang('passwordPlaceholder')"
|
||||
v-model="formData.password"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="form-input">
|
||||
<input
|
||||
class="uni-input"
|
||||
placeholder-class="placeholder-class"
|
||||
type="text"
|
||||
maxlength="30"
|
||||
password="true"
|
||||
:placeholder="$lang('rePasswordPlaceholder')"
|
||||
v-model="formData.rePassword"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<button type="primary" class="find-btn" @click="save">{{ $lang('save') }}</button>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import validate from 'common/js/validate.js';
|
||||
|
||||
import mypOne from '../_components/myp-one/myp-one.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
mypOne
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
findMode: 'mobile',
|
||||
codeText: '重新获取',
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
formData: {
|
||||
mobile: '',
|
||||
password: '',
|
||||
rePassword: '',
|
||||
dynacode: '',
|
||||
captcha: ''
|
||||
},
|
||||
stepShow: 0,
|
||||
isSend: false,
|
||||
captcha: {
|
||||
id: '',
|
||||
img: ''
|
||||
},
|
||||
registerConfig: {}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getCaptcha();
|
||||
},
|
||||
onShow() {
|
||||
this.getRegisterConfig();
|
||||
},
|
||||
methods: {
|
||||
input(val) {
|
||||
if (val.length == 4) {
|
||||
this.formData.dynacode = val;
|
||||
this.stepShow += 1;
|
||||
}
|
||||
},
|
||||
// 导航跳转
|
||||
navigateBack() {
|
||||
if (this.stepShow > 0) {
|
||||
this.stepShow -= 1;
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, '', 'redirectTo');
|
||||
}
|
||||
},
|
||||
// 下一步
|
||||
async nextStep() {
|
||||
let step0Rule = [
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: '请输入正确的手机号'
|
||||
},
|
||||
{
|
||||
name: 'captcha',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('captchaPlaceholder')
|
||||
}
|
||||
], //手机验证
|
||||
step0CheckRes;
|
||||
|
||||
step0CheckRes = validate.check(this.formData, step0Rule);
|
||||
|
||||
if (step0CheckRes) {
|
||||
this.findMode = 'mobile';
|
||||
let res = await this.$api.sendRequest({
|
||||
url: '/api/member/checkmobile',
|
||||
data: {
|
||||
mobile: this.formData.mobile
|
||||
},
|
||||
async: false
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: '该手机号未注册'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.sendDynaCode();
|
||||
},
|
||||
// 注册表单验证
|
||||
vertify() {
|
||||
let regConfig = this.registerConfig;
|
||||
let rule = [
|
||||
{
|
||||
name: 'password',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入密码'
|
||||
}
|
||||
];
|
||||
if (regConfig.pwd_len > 0) {
|
||||
rule.push({
|
||||
name: 'password',
|
||||
checkType: 'lengthMin',
|
||||
checkRule: regConfig.pwd_len,
|
||||
errorMsg: '密码长度不能小于' + regConfig.pwd_len + '位'
|
||||
});
|
||||
}
|
||||
if (regConfig.pwd_complexity != '') {
|
||||
let passwordErrorMsg = '密码需包含',
|
||||
reg = '';
|
||||
if (regConfig.pwd_complexity.indexOf('number') != -1) {
|
||||
reg += '(?=.*?[0-9])';
|
||||
passwordErrorMsg += '数字';
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('letter') != -1) {
|
||||
reg += '(?=.*?[a-z])';
|
||||
passwordErrorMsg += '、小写字母';
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('upper_case') != -1) {
|
||||
reg += '(?=.*?[A-Z])';
|
||||
passwordErrorMsg += '、大写字母';
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('symbol') != -1) {
|
||||
reg += '(?=.*?[#?!@$%^&*-])';
|
||||
passwordErrorMsg += '、特殊字符';
|
||||
}
|
||||
rule.push({
|
||||
name: 'password',
|
||||
checkType: 'reg',
|
||||
checkRule: reg,
|
||||
errorMsg: passwordErrorMsg
|
||||
});
|
||||
}
|
||||
|
||||
var checkRes = validate.check(this.formData, rule);
|
||||
if (checkRes) {
|
||||
if (this.formData.password != this.formData.rePassword) {
|
||||
this.$util.showToast({
|
||||
title: '两次密码不一致'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
// 获取验证码
|
||||
getCaptcha() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/captcha/captcha',
|
||||
data: {
|
||||
captcha_id: this.captcha.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.captcha = res.data;
|
||||
this.captcha.img = this.captcha.img.replace(/\r\n/g, '');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 发送动态验证码
|
||||
async sendDynaCode() {
|
||||
if (this.formData.captcha.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('captchaPlaceholder')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isSend) return;
|
||||
this.isSend = true;
|
||||
|
||||
var url,
|
||||
data = {
|
||||
captcha_id: this.captcha.id,
|
||||
captcha_code: this.formData.captcha
|
||||
};
|
||||
data[this.findMode] = this.formData.mobile;
|
||||
url = '/api/findpassword/mobilecode';
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
data: data,
|
||||
success: res => {
|
||||
let data = res.data;
|
||||
if (data.key) {
|
||||
if (this.seconds == 120 && this.timer == null) {
|
||||
this.timer = setInterval(() => {
|
||||
this.seconds--;
|
||||
this.codeText = '重新获取(' + this.seconds + 's)';
|
||||
}, 1000);
|
||||
}
|
||||
uni.setStorageSync('forgot_password_token', data.key);
|
||||
this.stepShow += 1;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
this.isSend = false;
|
||||
this.getCaptcha();
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSend = false;
|
||||
this.getCaptcha();
|
||||
}
|
||||
});
|
||||
},
|
||||
save() {
|
||||
if (this.vertify()) {
|
||||
var url,
|
||||
data = {
|
||||
code: this.formData.dynacode,
|
||||
key: uni.getStorageSync('forgot_password_token'),
|
||||
password: this.formData.password
|
||||
};
|
||||
data[this.findMode] = this.formData.mobile;
|
||||
url = '/api/findpassword/mobile';
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
data: data,
|
||||
success: res => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code == 0) {
|
||||
setTimeout(() => {
|
||||
uni.removeStorage({
|
||||
key: 'forgot_password_token'
|
||||
});
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {}, 'redirectTo');
|
||||
}, 1000);
|
||||
} else {
|
||||
this.stepShow -= 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取注册配置
|
||||
*/
|
||||
getRegisterConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/register/config',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.registerConfig = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
seconds(value) {
|
||||
if (value == 0) {
|
||||
this.seconds = 120;
|
||||
this.codeText = '重新获取';
|
||||
this.isSend = false;
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #ffffff !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.captcha {
|
||||
width: 170rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.find-form {
|
||||
padding: 100rpx 80rpx 0;
|
||||
|
||||
.form-input {
|
||||
margin-top: 60rpx;
|
||||
height: 60rpx;
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
|
||||
input {
|
||||
padding: 0;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
|
||||
.find-btn {
|
||||
margin: 374rpx 0 0;
|
||||
border-radius: $border-radius;
|
||||
color: #fff;
|
||||
|
||||
&[disabled] {
|
||||
background-color: #f7f7f7 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.forget-section {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
justify-content: space-between;
|
||||
margin-top: 10rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
|
||||
.align-type {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.header-wrap {
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
margin: calc(120rpx + 88rpx) auto 0;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
background-position: bottom;
|
||||
position: relative;
|
||||
|
||||
.title {
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-close {
|
||||
font-size: 52rpx;
|
||||
position: fixed;
|
||||
left: 24rpx;
|
||||
top: 72rpx;
|
||||
z-index: 9;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.placeholder-class {
|
||||
color: #bfbfbf;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="find" :style="themeColor">
|
||||
<view class="iconfont icon-close" @click="navigateBack()"></view>
|
||||
<view class="header-wrap">
|
||||
<block v-if="stepShow == 0">
|
||||
<view class="title">{{ $lang("common.ns-login.l16.t0") }}</view>
|
||||
<view><text class="color-tip">{{ $lang("login.find.l7") }}</text></view>
|
||||
</block>
|
||||
|
||||
<block v-if="stepShow == 1">
|
||||
<view class="title">{{ $lang("common.ns-login.l20.t0") }}</view>
|
||||
<view>
|
||||
<text class="color-tip">{ $lang("login.find.l13") } formData.mobile }}</text>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<block v-if="stepShow == 2">
|
||||
<view class="title">{{ $lang("login.find.l18") }}</view>
|
||||
<view><text class="color-tip">{{ $lang("login.find.l19") }}</text></view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="find-form">
|
||||
<!-- 输入手机号和验证码 -->
|
||||
<block v-if="stepShow == 0">
|
||||
<view class="form-input">
|
||||
<input
|
||||
class="uni-input"
|
||||
placeholder-class="placeholder-class"
|
||||
type="text"
|
||||
maxlength="17"
|
||||
v-model="formData.mobile"
|
||||
:placeholder="$lang('member.list.account_placeholder')"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="form-input align-type">
|
||||
<input
|
||||
class="uni-input info-content"
|
||||
placeholder-class="placeholder-class"
|
||||
type="number"
|
||||
maxlength="4"
|
||||
:placeholder="$lang('login.list.captcha_placeholder')"
|
||||
v-model="formData.captcha"
|
||||
/>
|
||||
<image :src="captcha.img" class="captcha" @click="getCaptcha" show-menu-by-longpress></image>
|
||||
</view>
|
||||
|
||||
<button type="primary" class="find-btn" @click="nextStep()">{{ $lang('common.button.next') }}</button>
|
||||
</block>
|
||||
|
||||
<!-- 输入动态码 -->
|
||||
<block v-if="stepShow == 1">
|
||||
<myp-one :maxlength="4" @input="input" ref="input" :auto-focus="true"></myp-one>
|
||||
<button type="primary" class="find-btn" :disabled="isSend" @click="sendDynaCode">{{ codeText }}</button>
|
||||
</block>
|
||||
<!-- 输入新密码 -->
|
||||
<block v-if="stepShow == 2">
|
||||
<view class="form-input">
|
||||
<input
|
||||
class="uni-input"
|
||||
placeholder-class="placeholder-class"
|
||||
type="text"
|
||||
maxlength="30"
|
||||
password="true"
|
||||
:placeholder="$lang('login.list.password_placeholder')"
|
||||
v-model="formData.password"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="form-input">
|
||||
<input
|
||||
class="uni-input"
|
||||
placeholder-class="placeholder-class"
|
||||
type="text"
|
||||
maxlength="30"
|
||||
password="true"
|
||||
:placeholder="$lang('login.list.re_password_placeholder')"
|
||||
v-model="formData.rePassword"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<button type="primary" class="find-btn" @click="save">{{ $lang('common.button.save') }}</button>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import validate from 'common/js/validate.js';
|
||||
|
||||
import mypOne from '../_components/myp-one/myp-one.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
mypOne
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
findMode: 'mobile',
|
||||
codeText: $lang('login.find.l100'),
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
formData: {
|
||||
mobile: '',
|
||||
password: '',
|
||||
rePassword: '',
|
||||
dynacode: '',
|
||||
captcha: ''
|
||||
},
|
||||
stepShow: 0,
|
||||
isSend: false,
|
||||
captcha: {
|
||||
id: '',
|
||||
img: ''
|
||||
},
|
||||
registerConfig: {}
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
this.getCaptcha();
|
||||
},
|
||||
onShow() {
|
||||
this.getRegisterConfig();
|
||||
},
|
||||
methods: {
|
||||
input(val) {
|
||||
if (val.length == 4) {
|
||||
this.formData.dynacode = val;
|
||||
this.stepShow += 1;
|
||||
}
|
||||
},
|
||||
// 导航跳转
|
||||
navigateBack() {
|
||||
if (this.stepShow > 0) {
|
||||
this.stepShow -= 1;
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, '', 'redirectTo');
|
||||
}
|
||||
},
|
||||
// 下一步
|
||||
async nextStep() {
|
||||
let step0Rule = [
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: $lang('common.ns-login.l393.t0')
|
||||
},
|
||||
{
|
||||
name: 'captcha',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('login.list.captcha_placeholder')
|
||||
}
|
||||
], //手机验证
|
||||
step0CheckRes;
|
||||
|
||||
step0CheckRes = validate.check(this.formData, step0Rule);
|
||||
|
||||
if (step0CheckRes) {
|
||||
this.findMode = 'mobile';
|
||||
let res = await this.$api.sendRequest({
|
||||
url: '/api/member/checkmobile',
|
||||
data: {
|
||||
mobile: this.formData.mobile
|
||||
},
|
||||
async: false
|
||||
});
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang('login.find.l169')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return false;
|
||||
}
|
||||
this.sendDynaCode();
|
||||
},
|
||||
// 注册表单验证
|
||||
vertify() {
|
||||
let regConfig = this.registerConfig;
|
||||
let rule = [
|
||||
{
|
||||
name: 'password',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('login.find.l188')
|
||||
}
|
||||
];
|
||||
if (regConfig.pwd_len > 0) {
|
||||
rule.push({
|
||||
name: 'password',
|
||||
checkType: 'lengthMin',
|
||||
checkRule: regConfig.pwd_len,
|
||||
errorMsg: $lang('login.find.l196') + regConfig.pwd_len + $lang('login.find.l196')
|
||||
});
|
||||
}
|
||||
if (regConfig.pwd_complexity != '') {
|
||||
let passwordErrorMsg = $lang('login.find.l200'),
|
||||
reg = '';
|
||||
if (regConfig.pwd_complexity.indexOf('number') != -1) {
|
||||
reg += '(?=.*?[0-9])';
|
||||
passwordErrorMsg += $lang('login.find.l204');
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('letter') != -1) {
|
||||
reg += '(?=.*?[a-z])';
|
||||
passwordErrorMsg += $lang('login.find.l208');
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('upper_case') != -1) {
|
||||
reg += '(?=.*?[A-Z])';
|
||||
passwordErrorMsg += $lang('login.find.l212');
|
||||
}
|
||||
if (regConfig.pwd_complexity.indexOf('symbol') != -1) {
|
||||
reg += '(?=.*?[#?!@$%^&*-])';
|
||||
passwordErrorMsg += $lang('login.find.l216');
|
||||
}
|
||||
rule.push({
|
||||
name: 'password',
|
||||
checkType: 'reg',
|
||||
checkRule: reg,
|
||||
errorMsg: passwordErrorMsg
|
||||
});
|
||||
}
|
||||
|
||||
var checkRes = validate.check(this.formData, rule);
|
||||
if (checkRes) {
|
||||
if (this.formData.password != this.formData.rePassword) {
|
||||
this.$util.showToast({
|
||||
title: $lang('login.find.l230')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
// 获取验证码
|
||||
getCaptcha() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/captcha/captcha',
|
||||
data: {
|
||||
captcha_id: this.captcha.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.captcha = res.data;
|
||||
this.captcha.img = this.captcha.img.replace(/\r\n/g, '');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 发送动态验证码
|
||||
async sendDynaCode() {
|
||||
if (this.formData.captcha.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('login.list.captcha_placeholder')
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.isSend) return;
|
||||
this.isSend = true;
|
||||
|
||||
var url,
|
||||
data = {
|
||||
captcha_id: this.captcha.id,
|
||||
captcha_code: this.formData.captcha
|
||||
};
|
||||
data[this.findMode] = this.formData.mobile;
|
||||
url = '/api/findpassword/mobilecode';
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
data: data,
|
||||
success: res => {
|
||||
let data = res.data;
|
||||
if (data.key) {
|
||||
if (this.seconds == 120 && this.timer == null) {
|
||||
this.timer = setInterval(() => {
|
||||
this.seconds--;
|
||||
this.codeText = $lang('login.find.l286') + this.seconds + 's)';
|
||||
}, 1000);
|
||||
}
|
||||
uni.setStorageSync('forgot_password_token', data.key);
|
||||
this.stepShow += 1;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
this.isSend = false;
|
||||
this.getCaptcha();
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSend = false;
|
||||
this.getCaptcha();
|
||||
}
|
||||
});
|
||||
},
|
||||
save() {
|
||||
if (this.vertify()) {
|
||||
var url,
|
||||
data = {
|
||||
code: this.formData.dynacode,
|
||||
key: uni.getStorageSync('forgot_password_token'),
|
||||
password: this.formData.password
|
||||
};
|
||||
data[this.findMode] = this.formData.mobile;
|
||||
url = '/api/findpassword/mobile';
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
data: data,
|
||||
success: res => {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (res.code == 0) {
|
||||
setTimeout(() => {
|
||||
uni.removeStorage({
|
||||
key: 'forgot_password_token'
|
||||
});
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {}, 'redirectTo');
|
||||
}, 1000);
|
||||
} else {
|
||||
this.stepShow -= 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 获取注册配置
|
||||
*/
|
||||
getRegisterConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/register/config',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.registerConfig = res.data.value;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
seconds(value) {
|
||||
if (value == 0) {
|
||||
this.seconds = 120;
|
||||
this.codeText = $lang('login.find.l100');
|
||||
this.isSend = false;
|
||||
clearInterval(this.timer);
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
background: #ffffff !important;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.captcha {
|
||||
width: 170rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.find-form {
|
||||
padding: 100rpx 80rpx 0;
|
||||
|
||||
.form-input {
|
||||
margin-top: 60rpx;
|
||||
height: 60rpx;
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
|
||||
input {
|
||||
padding: 0;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
|
||||
.find-btn {
|
||||
margin: 374rpx 0 0;
|
||||
border-radius: $border-radius;
|
||||
color: #fff;
|
||||
|
||||
&[disabled] {
|
||||
background-color: #f7f7f7 !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.forget-section {
|
||||
display: flex;
|
||||
flex-direction: row-reverse;
|
||||
justify-content: space-between;
|
||||
margin-top: 10rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
}
|
||||
|
||||
.align-type {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.header-wrap {
|
||||
width: 80%;
|
||||
height: 100%;
|
||||
margin: calc(120rpx + 88rpx) auto 0;
|
||||
background-repeat: no-repeat;
|
||||
background-size: contain;
|
||||
background-position: bottom;
|
||||
position: relative;
|
||||
|
||||
.title {
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-close {
|
||||
font-size: 52rpx;
|
||||
position: fixed;
|
||||
left: 24rpx;
|
||||
top: 72rpx;
|
||||
z-index: 9;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.placeholder-class {
|
||||
color: #bfbfbf;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,500 +1,500 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="false" class="container">
|
||||
<view class="header-wrap" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/member/head.png') + ')' }">
|
||||
<view class="t-b">
|
||||
<div v-html="$lang('welcomeText')"></div>
|
||||
</view>
|
||||
</view>
|
||||
<view class="body-wrap">
|
||||
<view class="form-wrap">
|
||||
<view class="input-wrap" v-show="loginMode == 'mobile'">
|
||||
<view class="content">
|
||||
<!-- <view class="area-code">+86</view> -->
|
||||
<input type="number" :placeholder="$lang('mobileInputPlaceholder')"
|
||||
placeholder-class="input-placeholder" class="input" maxlength="11"
|
||||
v-model="formData.mobile" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap" v-show="loginMode == 'account'">
|
||||
<view class="content">
|
||||
<input type="text" :placeholder="$lang('accountInputPlaceholder')"
|
||||
placeholder-class="input-placeholder" class="input" v-model="formData.account" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap" v-show="loginMode == 'account'">
|
||||
<view class="content">
|
||||
<input type="password" :placeholder="$lang('passwordInputPlaceholder')"
|
||||
placeholder-class="input-placeholder" class="input" v-model="formData.password" />
|
||||
<view class="align-right" v-show="loginMode == 'account'">
|
||||
<text @click="forgetPassword" @tap="forgetPassword">{{ $lang('forgetPasswordText') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap" v-show="loginMode == 'mobile'">
|
||||
<view class="content">
|
||||
<input type="text" :placeholder="$lang('dynacodeInputPlaceholder')"
|
||||
placeholder-class="input-placeholder" class="input" v-model="formData.dynacode" />
|
||||
<view class="dynacode"
|
||||
:class="dynacodeData.seconds == 120 ? 'color-base-text' : 'color-tip'"
|
||||
@click="sendMobileCode" @tap="sendMobileCode">{{ dynacodeData.codeText }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn_view">
|
||||
<button type="primary" @click="login" @tap="login" class="login-btn color-base-border color-base-bg"
|
||||
style="background: #2796f2 !important;border: none;">{{ $lang('loginButtonText') }}</button>
|
||||
</view>
|
||||
<view class="regisiter-agreement"
|
||||
style="margin: 0 50rpx;padding-top: 40rpx;line-height: 1.5;display: flex;">
|
||||
<!-- #ifndef MP-HARMONY -->
|
||||
<view style="" class="iconfont"
|
||||
:class="isAgree ? 'icon-fuxuankuang1 color-base-text' : 'icon-fuxuankuang2'"
|
||||
@click="isAgree = !isAgree" @tap="isAgree = !isAgree"></view>
|
||||
<!-- #endif -->
|
||||
<view style="text-align: left;margin-left: 10rpx;padding-top: 2rpx;">{{
|
||||
$lang('registerAgreementText') }} <text @click="tourl('/pages_tool/agreement/contenr?type=0')"
|
||||
@tap="tourl('/pages_tool/agreement/contenr?type=0')"
|
||||
style="color:#4395ff">{{ $lang('privacyPolicyText') }}</text> <text
|
||||
@click="tourl('/pages_tool/agreement/contenr?type=1')"
|
||||
@tap="tourl('/pages_tool/agreement/contenr?type=1')"
|
||||
style="color:#4395ff">{{ $lang('userServiceAgreementText') }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<register-reward ref="registerReward"></register-reward>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import validate from 'common/js/validate.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isAgree: false,
|
||||
// loginMode: 'account',
|
||||
loginMode: 'mobile',
|
||||
formData: {
|
||||
mobile: '',
|
||||
account: '',
|
||||
password: '',
|
||||
vercode: '',
|
||||
dynacode: '',
|
||||
key: ''
|
||||
},
|
||||
captcha: {
|
||||
id: '',
|
||||
img: ''
|
||||
},
|
||||
isSub: false, // 提交防重复
|
||||
back: '', // 返回页
|
||||
redirect: 'redirectTo', // 跳转方式
|
||||
dynacodeData: {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: this.$lang('getDynacode'),
|
||||
isSend: false
|
||||
},
|
||||
registerConfig: {
|
||||
register: 'mobile',
|
||||
login: ''
|
||||
},
|
||||
captchaConfig: 0,
|
||||
authInfo: null
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
this.getRegisterConfig();
|
||||
// this.getCaptchaConfig();
|
||||
this.authInfo = uni.getStorageSync('authInfo');
|
||||
},
|
||||
onShow() { },
|
||||
onReady() {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取验证码配置
|
||||
*/
|
||||
getCaptchaConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/config/getCaptchaConfig',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.captchaConfig = res.data.shop_reception_login;
|
||||
if (this.captchaConfig == 1) this.getCaptcha();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取注册配置
|
||||
*/
|
||||
getRegisterConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/register/config',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
// this.registerConfig = res.data.value;
|
||||
// if (this.registerConfig.login.indexOf('mobile') != -1) this.loginMode = 'mobile';
|
||||
// else this.loginMode = 'account';
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 切换登录方式
|
||||
*/
|
||||
switchLoginMode() {
|
||||
this.loginMode = this.loginMode == 'mobile' ? 'account' : 'mobile';
|
||||
},
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
getCaptcha() {
|
||||
if (this.captchaConfig == 0) return;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/captcha/captcha',
|
||||
data: {
|
||||
captcha_id: this.captcha.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.captcha = res.data;
|
||||
this.captcha.img = this.captcha.img.replace(/\r\n/g, '');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 去注册
|
||||
*/
|
||||
toRegister() {
|
||||
if (this.back) this.$util.redirectTo('/pages_tool/login/register', {
|
||||
back: encodeURIComponent(this.back)
|
||||
});
|
||||
else this.$util.redirectTo('/pages_tool/login/register');
|
||||
},
|
||||
/**
|
||||
* 忘记密码
|
||||
*/
|
||||
forgetPassword() {
|
||||
if (this.back) this.$util.redirectTo('/pages_tool/login/find', {
|
||||
back: encodeURIComponent(this.back)
|
||||
});
|
||||
else this.$util.redirectTo('/pages_tool/login/find');
|
||||
},
|
||||
tourl(url) {
|
||||
this.$util.redirectTo(url);
|
||||
},
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
login() {
|
||||
// #ifndef MP-HARMONY
|
||||
if (!this.isAgree) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('agreeAgreementTip')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
if (this.loginMode == 'account') {
|
||||
var url = '/api/login/login';
|
||||
data = {
|
||||
username: this.formData.account,
|
||||
password: this.formData.password
|
||||
};
|
||||
} else {
|
||||
var url = '/api/login/mobile',
|
||||
data = {
|
||||
mobile: this.formData.mobile,
|
||||
key: this.formData.key,
|
||||
code: this.formData.dynacode
|
||||
};
|
||||
}
|
||||
if (this.captcha.id != '') {
|
||||
data.captcha_id = this.captcha.id;
|
||||
data.captcha_code = this.formData.vercode;
|
||||
}
|
||||
if (this.authInfo) Object.assign(data, this.authInfo);
|
||||
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
|
||||
|
||||
if (this.verify(data)) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
this.$api.sendRequest({
|
||||
url,
|
||||
data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
var can_receive_registergift = res.data.can_receive_registergift;
|
||||
this.$store.commit('setToken', res.data.token);
|
||||
this.$store.dispatch('getCartNumber');
|
||||
this.getMemberInfo(() => {
|
||||
if (can_receive_registergift == 1) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('loginSuccessTip')
|
||||
});
|
||||
let back = this.back ? this.back : this.$util.MEMBER_PAGE_URL;
|
||||
if (this.$refs.registerReward) this.$refs.registerReward.open(back);
|
||||
} else {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(decodeURIComponent(this.back), {}, 'reLaunch');
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.getCaptcha();
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
this.getCaptcha();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 登录验证
|
||||
* @param {Object} data
|
||||
*/
|
||||
verify(data) {
|
||||
let rule = [];
|
||||
// 手机号验证
|
||||
if (this.loginMode == 'mobile') {
|
||||
rule = [{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('enterMobileTip')
|
||||
}, {
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: this.$lang('enterCorrectMobileTip')
|
||||
}];
|
||||
if (this.captchaConfig == 1) {
|
||||
if (this.captcha.id != '') rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('captchaPlaceholder')
|
||||
});
|
||||
}
|
||||
rule.push({
|
||||
name: 'code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('dynacodePlaceholder')
|
||||
});
|
||||
}
|
||||
|
||||
// 账号验证
|
||||
if (this.loginMode == 'account') {
|
||||
rule = [{
|
||||
name: 'username',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('accountPlaceholder')
|
||||
},
|
||||
{
|
||||
name: 'password',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('passwordPlaceholder')
|
||||
}
|
||||
];
|
||||
if (this.captchaConfig == 1) {
|
||||
if (this.captcha.id != '') rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('captchaPlaceholder')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var checkRes = validate.check(data, rule);
|
||||
if (checkRes) {
|
||||
return true;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
mobileAuthLogin(e) {
|
||||
if (e.detail.errMsg == 'getPhoneNumber:ok') {
|
||||
var data = {
|
||||
iv: e.detail.iv,
|
||||
encryptedData: e.detail.encryptedData
|
||||
};
|
||||
if (Object.keys(this.authInfo).length) {
|
||||
Object.assign(data, this.authInfo);
|
||||
if (this.authInfo.nickName) data.nickname = this.authInfo.nickName;
|
||||
if (this.authInfo.avatarUrl) data.headimg = this.authInfo.avatarUrl;
|
||||
}
|
||||
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
|
||||
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/tripartite/mobileauth',
|
||||
data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
var can_receive_registergift = res.data.can_receive_registergift;
|
||||
this.$store.commit('setToken', res.data.token);
|
||||
this.$store.dispatch('getCartNumber');
|
||||
this.getMemberInfo(() => {
|
||||
if (can_receive_registergift == 1) {
|
||||
let back = this.back ? this.back : this.$util.MEMBER_PAGE_URL;
|
||||
if (this.$refs.registerReward) this.$refs.registerReward.open(back);
|
||||
} else {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(decodeURIComponent(this.back), {}, this.redirect);
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, this.redirect);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: this.$lang('requestFailTip')
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 发送手机动态码
|
||||
*/
|
||||
sendMobileCode() {
|
||||
if (this.dynacodeData.seconds != 120 || this.dynacodeData.isSend) return;
|
||||
var data = {
|
||||
mobile: this.formData.mobile,
|
||||
captcha_id: this.captcha.id,
|
||||
captcha_code: this.formData.vercode
|
||||
};
|
||||
var rule = [{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入手机号'
|
||||
}, {
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: '请输入正确的手机号'
|
||||
}];
|
||||
if (this.captchaConfig == 1) {
|
||||
rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('enterCaptchaTip')
|
||||
});
|
||||
}
|
||||
var checkRes = validate.check(data, rule);
|
||||
if (!checkRes) {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.dynacodeData.isSend = true;
|
||||
this.dynacodeData.timer = setInterval(() => {
|
||||
this.dynacodeData.seconds--;
|
||||
this.dynacodeData.codeText = this.dynacodeData.seconds + 's后可重新获取';
|
||||
}, 1000);
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/login/mobileCode',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.formData.key = res.data.key;
|
||||
} else {
|
||||
this.refreshDynacodeData();
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: 'request:fail'
|
||||
});
|
||||
this.refreshDynacodeData();
|
||||
}
|
||||
});
|
||||
},
|
||||
refreshDynacodeData() {
|
||||
this.getCaptcha();
|
||||
clearInterval(this.dynacodeData.timer);
|
||||
this.dynacodeData = {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: '获取动态码',
|
||||
isSend: false
|
||||
};
|
||||
},
|
||||
getMemberInfo(callback) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/info',
|
||||
success: (res) => {
|
||||
if (res.code >= 0) {
|
||||
// 登录成功,存储会员信息
|
||||
this.$store.commit('setMemberInfo', res.data);
|
||||
if (callback) callback();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'dynacodeData.seconds': {
|
||||
handler(newValue, oldValue) {
|
||||
if (newValue == 0) {
|
||||
this.refreshDynacodeData();
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/common.scss';
|
||||
|
||||
.color-base-text {
|
||||
color: #2796f2 !important
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .reward-popup .uni-popup__wrapper-box {
|
||||
background: none !important;
|
||||
max-width: unset !important;
|
||||
max-height: unset !important;
|
||||
overflow: unset !important;
|
||||
}
|
||||
|
||||
::v-deep uni-toast .uni-simple-toast__text {
|
||||
background: red !important;
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="false" class="container">
|
||||
<view class="header-wrap" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/member/head.png') + ')' }">
|
||||
<view class="t-b">
|
||||
<div v-html="$lang('common.list.welcome_text')"></div>
|
||||
</view>
|
||||
</view>
|
||||
<view class="body-wrap">
|
||||
<view class="form-wrap">
|
||||
<view class="input-wrap" v-show="loginMode == 'mobile'">
|
||||
<view class="content">
|
||||
<!-- <view class="area-code">+86</view> -->
|
||||
<input type="number" :placeholder="$lang('login.list.mobile_input_placeholder')"
|
||||
placeholder-class="input-placeholder" class="input" maxlength="11"
|
||||
v-model="formData.mobile" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap" v-show="loginMode == 'account'">
|
||||
<view class="content">
|
||||
<input type="text" :placeholder="$lang('member.list.account_input_placeholder')"
|
||||
placeholder-class="input-placeholder" class="input" v-model="formData.account" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap" v-show="loginMode == 'account'">
|
||||
<view class="content">
|
||||
<input type="password" :placeholder="$lang('login.list.password_input_placeholder')"
|
||||
placeholder-class="input-placeholder" class="input" v-model="formData.password" />
|
||||
<view class="align-right" v-show="loginMode == 'account'">
|
||||
<text @click="forgetPassword" @tap="forgetPassword">{{ $lang('login.list.forget_password_text') }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="input-wrap" v-show="loginMode == 'mobile'">
|
||||
<view class="content">
|
||||
<input type="text" :placeholder="$lang('login.list.dynacode_input_placeholder')"
|
||||
placeholder-class="input-placeholder" class="input" v-model="formData.dynacode" />
|
||||
<view class="dynacode"
|
||||
:class="dynacodeData.seconds == 120 ? 'color-base-text' : 'color-tip'"
|
||||
@click="sendMobileCode" @tap="sendMobileCode">{{ dynacodeData.codeText }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn_view">
|
||||
<button type="primary" @click="login" @tap="login" class="login-btn color-base-border color-base-bg"
|
||||
style="background: #2796f2 !important;border: none;">{{ $lang('login.list.login_button_text') }}</button>
|
||||
</view>
|
||||
<view class="regisiter-agreement"
|
||||
style="margin: 0 50rpx;padding-top: 40rpx;line-height: 1.5;display: flex;">
|
||||
<!-- #ifndef MP-HARMONY -->
|
||||
<view style="" class="iconfont"
|
||||
:class="isAgree ? 'icon-fuxuankuang1 color-base-text' : 'icon-fuxuankuang2'"
|
||||
@click="isAgree = !isAgree" @tap="isAgree = !isAgree"></view>
|
||||
<!-- #endif -->
|
||||
<view style="text-align: left;margin-left: 10rpx;padding-top: 2rpx;">{{
|
||||
$lang('login.list.register_agreement_text') }} <text @click="tourl('/pages_tool/agreement/contenr?type=0')"
|
||||
@tap="tourl('/pages_tool/agreement/contenr?type=0')"
|
||||
style="color:#4395ff">{{ $lang('login.list.privacy_policy_text') }}</text> <text
|
||||
@click="tourl('/pages_tool/agreement/contenr?type=1')"
|
||||
@tap="tourl('/pages_tool/agreement/contenr?type=1')"
|
||||
style="color:#4395ff">{{ $lang('login.list.user_service_agreement_text') }}</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<register-reward ref="registerReward"></register-reward>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import validate from 'common/js/validate.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
isAgree: false,
|
||||
// loginMode: 'account',
|
||||
loginMode: 'mobile',
|
||||
formData: {
|
||||
mobile: '',
|
||||
account: '',
|
||||
password: '',
|
||||
vercode: '',
|
||||
dynacode: '',
|
||||
key: ''
|
||||
},
|
||||
captcha: {
|
||||
id: '',
|
||||
img: ''
|
||||
},
|
||||
isSub: false, // 提交防重复
|
||||
back: '', // 返回页
|
||||
redirect: 'redirectTo', // 跳转方式
|
||||
dynacodeData: {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: this.$lang('login.list.get_dynacode'),
|
||||
isSend: false
|
||||
},
|
||||
registerConfig: {
|
||||
register: 'mobile',
|
||||
login: ''
|
||||
},
|
||||
captchaConfig: 0,
|
||||
authInfo: null
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
this.getRegisterConfig();
|
||||
// this.getCaptchaConfig();
|
||||
this.authInfo = uni.getStorageSync('authInfo');
|
||||
},
|
||||
onShow() { },
|
||||
onReady() {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 获取验证码配置
|
||||
*/
|
||||
getCaptchaConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/config/getCaptchaConfig',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.captchaConfig = res.data.shop_reception_login;
|
||||
if (this.captchaConfig == 1) this.getCaptcha();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取注册配置
|
||||
*/
|
||||
getRegisterConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/register/config',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
// this.registerConfig = res.data.value;
|
||||
// if (this.registerConfig.login.indexOf('mobile') != -1) this.loginMode = 'mobile';
|
||||
// else this.loginMode = 'account';
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 切换登录方式
|
||||
*/
|
||||
switchLoginMode() {
|
||||
this.loginMode = this.loginMode == 'mobile' ? 'account' : 'mobile';
|
||||
},
|
||||
/**
|
||||
* 获取验证码
|
||||
*/
|
||||
getCaptcha() {
|
||||
if (this.captchaConfig == 0) return;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/captcha/captcha',
|
||||
data: {
|
||||
captcha_id: this.captcha.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.captcha = res.data;
|
||||
this.captcha.img = this.captcha.img.replace(/\r\n/g, '');
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 去注册
|
||||
*/
|
||||
toRegister() {
|
||||
if (this.back) this.$util.redirectTo('/pages_tool/login/register', {
|
||||
back: encodeURIComponent(this.back)
|
||||
});
|
||||
else this.$util.redirectTo('/pages_tool/login/register');
|
||||
},
|
||||
/**
|
||||
* 忘记密码
|
||||
*/
|
||||
forgetPassword() {
|
||||
if (this.back) this.$util.redirectTo('/pages_tool/login/find', {
|
||||
back: encodeURIComponent(this.back)
|
||||
});
|
||||
else this.$util.redirectTo('/pages_tool/login/find');
|
||||
},
|
||||
tourl(url) {
|
||||
this.$util.redirectTo(url);
|
||||
},
|
||||
/**
|
||||
* 登录
|
||||
*/
|
||||
login() {
|
||||
// #ifndef MP-HARMONY
|
||||
if (!this.isAgree) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('login.list.agree_agreement_tip')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
// #endif
|
||||
if (this.loginMode == 'account') {
|
||||
var url = '/api/login/login';
|
||||
data = {
|
||||
username: this.formData.account,
|
||||
password: this.formData.password
|
||||
};
|
||||
} else {
|
||||
var url = '/api/login/mobile',
|
||||
data = {
|
||||
mobile: this.formData.mobile,
|
||||
key: this.formData.key,
|
||||
code: this.formData.dynacode
|
||||
};
|
||||
}
|
||||
if (this.captcha.id != '') {
|
||||
data.captcha_id = this.captcha.id;
|
||||
data.captcha_code = this.formData.vercode;
|
||||
}
|
||||
if (this.authInfo) Object.assign(data, this.authInfo);
|
||||
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
|
||||
|
||||
if (this.verify(data)) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
this.$api.sendRequest({
|
||||
url,
|
||||
data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
var can_receive_registergift = res.data.can_receive_registergift;
|
||||
this.$store.commit('setToken', res.data.token);
|
||||
this.$store.dispatch('getCartNumber');
|
||||
this.getMemberInfo(() => {
|
||||
if (can_receive_registergift == 1) {
|
||||
this.$util.showToast({
|
||||
title: this.$lang('login.list.login_success_tip')
|
||||
});
|
||||
let back = this.back ? this.back : this.$util.MEMBER_PAGE_URL;
|
||||
if (this.$refs.registerReward) this.$refs.registerReward.open(back);
|
||||
} else {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(decodeURIComponent(this.back), {}, 'reLaunch');
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.getCaptcha();
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
this.getCaptcha();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 登录验证
|
||||
* @param {Object} data
|
||||
*/
|
||||
verify(data) {
|
||||
let rule = [];
|
||||
// 手机号验证
|
||||
if (this.loginMode == 'mobile') {
|
||||
rule = [{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('login.list.enter_mobile_tip')
|
||||
}, {
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: this.$lang('login.list.enter_correct_mobile_tip')
|
||||
}];
|
||||
if (this.captchaConfig == 1) {
|
||||
if (this.captcha.id != '') rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('login.list.captcha_placeholder')
|
||||
});
|
||||
}
|
||||
rule.push({
|
||||
name: 'code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('login.list.dynacode_placeholder')
|
||||
});
|
||||
}
|
||||
|
||||
// 账号验证
|
||||
if (this.loginMode == 'account') {
|
||||
rule = [{
|
||||
name: 'username',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('member.list.account_placeholder')
|
||||
},
|
||||
{
|
||||
name: 'password',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('login.list.password_placeholder')
|
||||
}
|
||||
];
|
||||
if (this.captchaConfig == 1) {
|
||||
if (this.captcha.id != '') rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('login.list.captcha_placeholder')
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
var checkRes = validate.check(data, rule);
|
||||
if (checkRes) {
|
||||
return true;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return false;
|
||||
}
|
||||
},
|
||||
mobileAuthLogin(e) {
|
||||
if (e.detail.errMsg == 'getPhoneNumber:ok') {
|
||||
var data = {
|
||||
iv: e.detail.iv,
|
||||
encryptedData: e.detail.encryptedData
|
||||
};
|
||||
if (Object.keys(this.authInfo).length) {
|
||||
Object.assign(data, this.authInfo);
|
||||
if (this.authInfo.nickName) data.nickname = this.authInfo.nickName;
|
||||
if (this.authInfo.avatarUrl) data.headimg = this.authInfo.avatarUrl;
|
||||
}
|
||||
if (uni.getStorageSync('source_member')) data.source_member = uni.getStorageSync('source_member');
|
||||
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/tripartite/mobileauth',
|
||||
data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
var can_receive_registergift = res.data.can_receive_registergift;
|
||||
this.$store.commit('setToken', res.data.token);
|
||||
this.$store.dispatch('getCartNumber');
|
||||
this.getMemberInfo(() => {
|
||||
if (can_receive_registergift == 1) {
|
||||
let back = this.back ? this.back : this.$util.MEMBER_PAGE_URL;
|
||||
if (this.$refs.registerReward) this.$refs.registerReward.open(back);
|
||||
} else {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(decodeURIComponent(this.back), {}, this.redirect);
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, this.redirect);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: this.$lang('common.list.request_fail_tip')
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 发送手机动态码
|
||||
*/
|
||||
sendMobileCode() {
|
||||
if (this.dynacodeData.seconds != 120 || this.dynacodeData.isSend) return;
|
||||
var data = {
|
||||
mobile: this.formData.mobile,
|
||||
captcha_id: this.captcha.id,
|
||||
captcha_code: this.formData.vercode
|
||||
};
|
||||
var rule = [{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('common.ns-login.l16.t0')
|
||||
}, {
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: $lang('common.ns-login.l393.t0')
|
||||
}];
|
||||
if (this.captchaConfig == 1) {
|
||||
rule.push({
|
||||
name: 'captcha_code',
|
||||
checkType: 'required',
|
||||
errorMsg: this.$lang('login.list.enter_captcha_tip')
|
||||
});
|
||||
}
|
||||
var checkRes = validate.check(data, rule);
|
||||
if (!checkRes) {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
return;
|
||||
}
|
||||
this.dynacodeData.isSend = true;
|
||||
this.dynacodeData.timer = setInterval(() => {
|
||||
this.dynacodeData.seconds--;
|
||||
this.dynacodeData.codeText = this.dynacodeData.seconds + $lang('common.ns-login.l414.t0');
|
||||
}, 1000);
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/login/mobileCode',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.formData.key = res.data.key;
|
||||
} else {
|
||||
this.refreshDynacodeData();
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: 'request:fail'
|
||||
});
|
||||
this.refreshDynacodeData();
|
||||
}
|
||||
});
|
||||
},
|
||||
refreshDynacodeData() {
|
||||
this.getCaptcha();
|
||||
clearInterval(this.dynacodeData.timer);
|
||||
this.dynacodeData = {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: $lang('common.ns-login.l169.t0'),
|
||||
isSend: false
|
||||
};
|
||||
},
|
||||
getMemberInfo(callback) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/info',
|
||||
success: (res) => {
|
||||
if (res.code >= 0) {
|
||||
// 登录成功,存储会员信息
|
||||
this.$store.commit('setMemberInfo', res.data);
|
||||
if (callback) callback();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'dynacodeData.seconds': {
|
||||
handler(newValue, oldValue) {
|
||||
if (newValue == 0) {
|
||||
this.refreshDynacodeData();
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/common.scss';
|
||||
|
||||
.color-base-text {
|
||||
color: #2796f2 !important
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .reward-popup .uni-popup__wrapper-box {
|
||||
background: none !important;
|
||||
max-width: unset !important;
|
||||
max-height: unset !important;
|
||||
overflow: unset !important;
|
||||
}
|
||||
|
||||
::v-deep uni-toast .uni-simple-toast__text {
|
||||
background: red !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,453 +1,453 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" v-if="storeToken">
|
||||
<block slot="list">
|
||||
<view class="nc-info-list-content">
|
||||
<view class="list-item balance-item" @click="setBalanceDefault()"
|
||||
v-if="type == 'fenxiao' && payList && payList.balance">
|
||||
<view class="item-top">
|
||||
<view class="item-left">
|
||||
<view class="title-text">提现到余额</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="dataList.length > 0">
|
||||
<view class="list-item" v-for="(item, index) in dataList" :key="index">
|
||||
<view class="item-top">
|
||||
<view class="item-left">
|
||||
<view class="title-text">{{ item.withdraw_type_name }}</view>
|
||||
<view class="info-content">
|
||||
<text class="top-title">{{ item.realname }}</text>
|
||||
<text class="top-num">{{ item.mobile }}</text>
|
||||
</view>
|
||||
<view class="content-bottom">
|
||||
<block v-if="item.withdraw_type == 'alipay'">
|
||||
提现账号:{{ item.bank_account }}
|
||||
</block>
|
||||
<block v-if="item.withdraw_type == 'bank'">
|
||||
银行名称 :{{ item.branch_bank_name }}
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-btn" @click.stop="editAccount('edit', item.id)">修改</view>
|
||||
</view>
|
||||
|
||||
<view class="item-bottom">
|
||||
<view class="account-default" @click="setDefault(item.id, item.is_default)">
|
||||
<text class="default">设为默认账户</text>
|
||||
<switch v-if="item.is_default == 1" checked disabled style="transform:scale(0.7)"
|
||||
:color="themeStyle.main_color" />
|
||||
<switch v-else style="transform:scale(0.7)" :color="themeStyle.main_color" />
|
||||
</view>
|
||||
<view class="account-btn">
|
||||
<text class="delete" v-if="item.is_default != 1" @click="deleteAccount(item.id)">
|
||||
<text class="iconfont iconicon7"></text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view
|
||||
v-if="dataList.length <= 0 && (type != 'fenxiao' || (type == 'fenxiao' && payList && !payList.balance))"
|
||||
class="empty-box">
|
||||
<image :src="$util.img('public/uniapp/member/account/empty.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="tips">暂无账户信息,请添加</view>
|
||||
<button type="primary" class="add-account" @click="editAccount('add')">{{ $lang('newAddAccount')
|
||||
}}</button>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<view class="btn-add" v-if="dataList.length > 0 || (type == 'fenxiao' && payList && payList.balance)">
|
||||
<button class="add-account" type="primary" @click="editAccount('add')">{{ $lang('newAddAccount') }}</button>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataList: [], //账号列表
|
||||
back: '', // 返回页
|
||||
redirect: 'redirectTo', // 跳转方式
|
||||
type: 'member',
|
||||
payList: null
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
if (option.type) this.type = option.type;
|
||||
if (option.redirect) this.redirect = option.redirect;
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
this.getTransferType();
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/account');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 编辑提现账户信息
|
||||
editAccount(type, id) {
|
||||
let data = {};
|
||||
data.type = this.type;
|
||||
if (type == 'edit') data.id = id;
|
||||
if (this.back) data.back = this.back;
|
||||
this.$util.redirectTo('/pages_tool/member/account_edit', data);
|
||||
},
|
||||
deleteAccount(id) {
|
||||
uni.showModal({
|
||||
title: '操作提示',
|
||||
content: '确定要删除该账户吗?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/delete',
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
success: result => {
|
||||
if (result.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: '删除成功'
|
||||
});
|
||||
this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '删除失败'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
setDefault(id, is_default) {
|
||||
if (is_default == 1) return;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/setdefault',
|
||||
data: {
|
||||
id
|
||||
},
|
||||
success: res => {
|
||||
if (res.data >= 0) {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(this.back, {}, this.redirect);
|
||||
} else {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.show();
|
||||
this.dataList = [];
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
setBalanceDefault() {
|
||||
this.$util.redirectTo(this.back, {
|
||||
'is_balance': 1
|
||||
}, this.redirect);
|
||||
},
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.dataList = []; //如果是第一页需手动制空列表
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
|
||||
let withdrawType = {
|
||||
bank: '银行',
|
||||
alipay: '支付宝',
|
||||
wechatpay: '微信'
|
||||
};
|
||||
|
||||
this.dataList.forEach(item => {
|
||||
item.withdraw_type_name = withdrawType[item.withdraw_type] ? withdrawType[
|
||||
item.withdraw_type] : '';
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
getTransferType() {
|
||||
let url = this.type == "member" ? "/api/memberwithdraw/transferType" :
|
||||
"/fenxiao/api/withdraw/transferType";
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.empty-box {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.tips {
|
||||
color: #999999;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.get-account,
|
||||
.add-account {
|
||||
width: 50%;
|
||||
height: 78rpx;
|
||||
line-height: 78rpx;
|
||||
border-radius: 78rpx;
|
||||
margin-top: 50rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.get-account {
|
||||
width: 50%;
|
||||
background: #fff;
|
||||
color: $base-color;
|
||||
border: 2rpx solid $base-color;
|
||||
margin-top: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.mescroll-downwarp+.empty-box {
|
||||
height: calc(100vh - 260rpx);
|
||||
}
|
||||
|
||||
|
||||
.btn-add {
|
||||
margin-top: 60rpx;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
z-index: 10;
|
||||
|
||||
.add-account {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 80rpx;
|
||||
margin: 30rpx 0 30rpx;
|
||||
font-size: $font-size-toolbar;
|
||||
|
||||
text {
|
||||
margin-right: 10rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.zw {
|
||||
margin-top: 250rpx;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
margin: 0 0;
|
||||
padding: 24rpx $margin-both;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
margin-bottom: 18rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
&.balance-item {
|
||||
.item-top {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.item-mr {
|
||||
font-size: $font-size-activity-tag;
|
||||
color: #fff;
|
||||
height: 150rpx;
|
||||
width: 150rpx;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
right: -90rpx;
|
||||
top: -90rpx;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.item-top {
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
padding-bottom: 26rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.item-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: calc(100% - 100rpx);
|
||||
|
||||
.title-text {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
display: flex;
|
||||
|
||||
.top-title {
|
||||
font-size: 26rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.top-num {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content-bottom {
|
||||
font-size: 26rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-btn {
|
||||
width: 100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-top: 24rpx;
|
||||
|
||||
.account-default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
color: #666666;
|
||||
|
||||
.default {}
|
||||
|
||||
.iconfont {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.account-btn {
|
||||
font-size: $font-size-base;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.edit {
|
||||
text {
|
||||
vertical-align: center;
|
||||
margin-right: 10rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.delete {
|
||||
background: #F1F1F1;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
padding: 10rpx;
|
||||
text-align: center;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
::v-deep .mescroll-upwarp {
|
||||
padding-bottom: 150rpx;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input {
|
||||
height: 48rpx !important;
|
||||
width: 88rpx !important;
|
||||
}
|
||||
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input:after {
|
||||
height: 44rpx !important;
|
||||
width: 44rpx !important;
|
||||
}
|
||||
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input:before {
|
||||
background-color: #EDEDED !important;
|
||||
height: 44rpx !important;
|
||||
width: 90rpx !important;
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" v-if="storeToken">
|
||||
<block slot="list">
|
||||
<view class="nc-info-list-content">
|
||||
<view class="list-item balance-item" @click="setBalanceDefault()"
|
||||
v-if="type == 'fenxiao' && payList && payList.balance">
|
||||
<view class="item-top">
|
||||
<view class="item-left">
|
||||
<view class="title-text">{{ $lang("member.account.l10") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="dataList.length > 0">
|
||||
<view class="list-item" v-for="(item, index) in dataList" :key="index">
|
||||
<view class="item-top">
|
||||
<view class="item-left">
|
||||
<view class="title-text">{{ item.withdraw_type_name }}</view>
|
||||
<view class="info-content">
|
||||
<text class="top-title">{{ item.realname }}</text>
|
||||
<text class="top-num">{{ item.mobile }}</text>
|
||||
</view>
|
||||
<view class="content-bottom">
|
||||
<block v-if="item.withdraw_type == 'alipay'">
|
||||
提现账号:{{ item.bank_account }}
|
||||
</block>
|
||||
<block v-if="item.withdraw_type == 'bank'">
|
||||
银行名称 :{{ item.branch_bank_name }}
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-btn" @click.stop="editAccount('edit', item.id)">{{ $lang("member.account.l32") }}</view>
|
||||
</view>
|
||||
|
||||
<view class="item-bottom">
|
||||
<view class="account-default" @click="setDefault(item.id, item.is_default)">
|
||||
<text class="default">{{ $lang("member.account.l37") }}</text>
|
||||
<switch v-if="item.is_default == 1" checked disabled style="transform:scale(0.7)"
|
||||
:color="themeStyle.main_color" />
|
||||
<switch v-else style="transform:scale(0.7)" :color="themeStyle.main_color" />
|
||||
</view>
|
||||
<view class="account-btn">
|
||||
<text class="delete" v-if="item.is_default != 1" @click="deleteAccount(item.id)">
|
||||
<text class="iconfont iconicon7"></text>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view
|
||||
v-if="dataList.length <= 0 && (type != 'fenxiao' || (type == 'fenxiao' && payList && !payList.balance))"
|
||||
class="empty-box">
|
||||
<image :src="$util.img('public/uniapp/member/account/empty.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="tips">{{ $lang("member.account.l55") }}</view>
|
||||
<button type="primary" class="add-account" @click="editAccount('add')">{{ $lang('member.list.new_add_account')
|
||||
}}</button>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<view class="btn-add" v-if="dataList.length > 0 || (type == 'fenxiao' && payList && payList.balance)">
|
||||
<button class="add-account" type="primary" @click="editAccount('add')">{{ $lang('member.list.new_add_account') }}</button>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataList: [], //账号列表
|
||||
back: '', // 返回页
|
||||
redirect: 'redirectTo', // 跳转方式
|
||||
type: 'member',
|
||||
payList: null
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
if (option.type) this.type = option.type;
|
||||
if (option.redirect) this.redirect = option.redirect;
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
this.getTransferType();
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/account');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 编辑提现账户信息
|
||||
editAccount(type, id) {
|
||||
let data = {};
|
||||
data.type = this.type;
|
||||
if (type == 'edit') data.id = id;
|
||||
if (this.back) data.back = this.back;
|
||||
this.$util.redirectTo('/pages_tool/member/account_edit', data);
|
||||
},
|
||||
deleteAccount(id) {
|
||||
uni.showModal({
|
||||
title: $lang('member.account.l106'),
|
||||
content: $lang('member.account.l107'),
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/delete',
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
success: result => {
|
||||
if (result.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.account.l118')
|
||||
});
|
||||
this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.account.l123')
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
setDefault(id, is_default) {
|
||||
if (is_default == 1) return;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/setdefault',
|
||||
data: {
|
||||
id
|
||||
},
|
||||
success: res => {
|
||||
if (res.data >= 0) {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(this.back, {}, this.redirect);
|
||||
} else {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.show();
|
||||
this.dataList = [];
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
setBalanceDefault() {
|
||||
this.$util.redirectTo(this.back, {
|
||||
'is_balance': 1
|
||||
}, this.redirect);
|
||||
},
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.dataList = []; //如果是第一页需手动制空列表
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
|
||||
let withdrawType = {
|
||||
bank: $lang('member.account.l184'),
|
||||
alipay: $lang('fenxiao.withdraw_list.l12'),
|
||||
wechatpay: $lang('fenxiao.withdraw_list.l13')
|
||||
};
|
||||
|
||||
this.dataList.forEach(item => {
|
||||
item.withdraw_type_name = withdrawType[item.withdraw_type] ? withdrawType[
|
||||
item.withdraw_type] : '';
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
getTransferType() {
|
||||
let url = this.type == "member" ? "/api/memberwithdraw/transferType" :
|
||||
"/fenxiao/api/withdraw/transferType";
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.empty-box {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
image {
|
||||
width: 50%;
|
||||
}
|
||||
|
||||
.tips {
|
||||
color: #999999;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
.get-account,
|
||||
.add-account {
|
||||
width: 50%;
|
||||
height: 78rpx;
|
||||
line-height: 78rpx;
|
||||
border-radius: 78rpx;
|
||||
margin-top: 50rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.get-account {
|
||||
width: 50%;
|
||||
background: #fff;
|
||||
color: $base-color;
|
||||
border: 2rpx solid $base-color;
|
||||
margin-top: 20rpx;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
|
||||
.mescroll-downwarp+.empty-box {
|
||||
height: calc(100vh - 260rpx);
|
||||
}
|
||||
|
||||
|
||||
.btn-add {
|
||||
margin-top: 60rpx;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
position: fixed;
|
||||
padding: 0 30rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
z-index: 10;
|
||||
|
||||
.add-account {
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: 80rpx;
|
||||
margin: 30rpx 0 30rpx;
|
||||
font-size: $font-size-toolbar;
|
||||
|
||||
text {
|
||||
margin-right: 10rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.zw {
|
||||
margin-top: 250rpx;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
margin: 0 0;
|
||||
padding: 24rpx $margin-both;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
background-color: #fff;
|
||||
margin-bottom: 18rpx;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
|
||||
&.balance-item {
|
||||
.item-top {
|
||||
border: none;
|
||||
padding: 0;
|
||||
}
|
||||
}
|
||||
|
||||
&:first-child {
|
||||
margin-top: 18rpx;
|
||||
}
|
||||
|
||||
.item-mr {
|
||||
font-size: $font-size-activity-tag;
|
||||
color: #fff;
|
||||
height: 150rpx;
|
||||
width: 150rpx;
|
||||
display: flex;
|
||||
align-items: flex-end;
|
||||
justify-content: center;
|
||||
position: absolute;
|
||||
right: -90rpx;
|
||||
top: -90rpx;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.item-top {
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
padding-bottom: 26rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
|
||||
.item-left {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
width: calc(100% - 100rpx);
|
||||
|
||||
.title-text {
|
||||
font-size: 30rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
display: flex;
|
||||
|
||||
.top-title {
|
||||
font-size: 26rpx;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
|
||||
.top-num {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.content-bottom {
|
||||
font-size: 26rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-btn {
|
||||
width: 100rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #999;
|
||||
font-size: 24rpx;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.item-bottom {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
padding-top: 24rpx;
|
||||
|
||||
.account-default {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 24rpx;
|
||||
line-height: 1;
|
||||
color: #666666;
|
||||
|
||||
.default {}
|
||||
|
||||
.iconfont {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.account-btn {
|
||||
font-size: $font-size-base;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.edit {
|
||||
text {
|
||||
vertical-align: center;
|
||||
margin-right: 10rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.delete {
|
||||
background: #F1F1F1;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
border-radius: 50%;
|
||||
padding: 10rpx;
|
||||
text-align: center;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
text {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<style lang="scss">
|
||||
::v-deep .mescroll-upwarp {
|
||||
padding-bottom: 150rpx;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input {
|
||||
height: 48rpx !important;
|
||||
width: 88rpx !important;
|
||||
}
|
||||
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input:after {
|
||||
height: 44rpx !important;
|
||||
width: 44rpx !important;
|
||||
}
|
||||
|
||||
.item-bottom>>>.uni-switch-wrapper .uni-switch-input:before {
|
||||
background-color: #EDEDED !important;
|
||||
height: 44rpx !important;
|
||||
width: 90rpx !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,323 +1,323 @@
|
||||
<template>
|
||||
<view class="account-list-content" :style="themeColor">
|
||||
<view class="edit-item">
|
||||
<text class="tit">{{ $lang('name') }}</text>
|
||||
<input class="desc uni-input" type="text" maxlength="30" placeholder="请输入真实姓名" name="name" v-model="formData.realname" />
|
||||
</view>
|
||||
<view class="edit-item">
|
||||
<text class="tit">{{ $lang('mobilePhone') }}</text>
|
||||
<input class="desc uni-input" type="number" maxlength="11" placeholder="请输入手机号" v-model="formData.mobile" />
|
||||
</view>
|
||||
<view class="edit-item">
|
||||
<text class="tit">{{ $lang('accountType') }}</text>
|
||||
<picker @change="bindPickerChange" :value="index" :range="payList" class="picker">
|
||||
<text class="desc uni-input">{{ payList[index] }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="edit-item" v-if="formData.withdraw_type == 'bank'">
|
||||
<text class="tit">银行名称</text>
|
||||
<input class="desc uni-input" type="text" maxlength="50" placeholder="请输入银行名称" v-model.trim="formData.branch_bank_name" />
|
||||
</view>
|
||||
<view class="edit-item" v-if="formData.withdraw_type != 'wechatpay'">
|
||||
<text class="tit">提现账号</text>
|
||||
<input class="desc uni-input" type="text" maxlength="30" placeholder="请输入提现账号" v-model.trim="formData.bank_account" />
|
||||
</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="add" @click="saveAccount">{{ $lang('save') }}</button>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import validate from 'common/js/validate.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
realname: '',
|
||||
mobile: '',
|
||||
withdraw_type: '',
|
||||
bank_account: '',
|
||||
branch_bank_name: ''
|
||||
},
|
||||
payList: [],
|
||||
index: 0,
|
||||
flag: false,
|
||||
transferType: [],
|
||||
accountInfo: null,
|
||||
back: '',
|
||||
type: 'member'
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.id) this.formData.id = option.id;
|
||||
if (option.back) this.back = option.back;
|
||||
if (option.type) this.type = option.type; // 区分是从会员提现还是从分销提现
|
||||
},
|
||||
onShow() {
|
||||
if (this.formData.id) {
|
||||
this.getAccountDetail(this.formData.id);
|
||||
} else {
|
||||
this.getTransferType();
|
||||
}
|
||||
if (this.formData.id) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '编辑账户'
|
||||
});
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '新增账户'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getAccountDetail(id) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/info',
|
||||
data: {
|
||||
id: this.formData.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.accountInfo = res.data;
|
||||
this.formData.realname = res.data.realname;
|
||||
this.formData.mobile = res.data.mobile;
|
||||
this.formData.bank_account = res.data.bank_account;
|
||||
this.formData.branch_bank_name = res.data.branch_bank_name;
|
||||
this.formData.withdraw_type = res.data.withdraw_type;
|
||||
}
|
||||
this.getTransferType();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
this.getTransferType();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取转账方式
|
||||
*/
|
||||
getTransferType() {
|
||||
this.payList = [];
|
||||
let url = this.type == "member" ? "/api/memberwithdraw/transferType" : "/fenxiao/api/withdraw/transferType";
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
delete res.data.balance;
|
||||
this.transferType = res.data;
|
||||
for (let v in this.transferType) {
|
||||
this.payList.push(this.transferType[v]);
|
||||
}
|
||||
|
||||
if (this.payList.length == 1 && this.payList[0] == '银行卡') {
|
||||
this.formData.withdraw_type = 'bank';
|
||||
}
|
||||
|
||||
this.payList.reverse();
|
||||
if (!this.formData.id && this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
|
||||
if (this.accountInfo && this.$util.inArray(this.accountInfo.withdraw_type_name, this.payList) == -1) {
|
||||
this.payList.push(this.accountInfo.withdraw_type_name);
|
||||
}
|
||||
|
||||
if (this.payList.length && this.accountInfo) {
|
||||
this.index = this.$util.inArray(this.accountInfo.withdraw_type_name, this.payList);
|
||||
}
|
||||
|
||||
if (!this.formData.withdraw_type && this.payList.length) {
|
||||
switch (this.payList[0]) {
|
||||
case '银行卡':
|
||||
this.formData.withdraw_type = 'bank';
|
||||
break;
|
||||
case '支付宝':
|
||||
this.formData.withdraw_type = 'alipay';
|
||||
break;
|
||||
case '微信零钱':
|
||||
this.formData.withdraw_type = 'wechatpay';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
bindPickerChange(e) {
|
||||
this.index = e.detail.value;
|
||||
let value = '';
|
||||
for (let i in this.transferType) {
|
||||
if (this.transferType[i] == this.payList[this.index]) {
|
||||
value = i;
|
||||
}
|
||||
}
|
||||
if (value != '') this.formData.withdraw_type = value;
|
||||
},
|
||||
vertify() {
|
||||
var rule = [
|
||||
{
|
||||
name: 'realname',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入姓名'
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入手机号'
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: '请输入正确的手机号'
|
||||
},
|
||||
{
|
||||
name: 'withdraw_type',
|
||||
checkType: 'required',
|
||||
errorMsg: '请选择账户类型'
|
||||
}
|
||||
];
|
||||
if (this.formData.withdraw_type == 'bank') {
|
||||
rule.push({
|
||||
name: 'branch_bank_name',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入银行名称'
|
||||
});
|
||||
}
|
||||
if (this.formData.withdraw_type != 'wechatpay') {
|
||||
rule.push({
|
||||
name: 'bank_account',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入提现账号'
|
||||
});
|
||||
}
|
||||
var checkRes = validate.check(this.formData, rule);
|
||||
if (checkRes) {
|
||||
return true;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
this.flag = false;
|
||||
return false;
|
||||
}
|
||||
},
|
||||
saveAccount() {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
if (this.vertify()) {
|
||||
let url = !this.formData.id ? 'add' : 'edit';
|
||||
let data = {};
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/' + url,
|
||||
data: {
|
||||
id: this.formData.id,
|
||||
realname: this.formData.realname,
|
||||
mobile: this.formData.mobile,
|
||||
withdraw_type: this.formData.withdraw_type,
|
||||
bank_account: this.formData.bank_account,
|
||||
branch_bank_name: this.formData.branch_bank_name
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
if (!this.formData.id) {
|
||||
this.$util.showToast({
|
||||
title: '添加成功'
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '修改成功'
|
||||
});
|
||||
}
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(this.back, {}, this.redirect);
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/member/account');
|
||||
}
|
||||
} else {
|
||||
this.flag = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.account-list-content {
|
||||
margin: $margin-updown $margin-both;
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: $border-radius;
|
||||
|
||||
.edit-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
background-color: #fff;
|
||||
|
||||
.tit {
|
||||
width: 120rpx;
|
||||
}
|
||||
|
||||
.desc {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&:first-of-type {
|
||||
margin-top: $uni-spacing-row-base;
|
||||
}
|
||||
|
||||
.picker {
|
||||
flex: 1;
|
||||
|
||||
text {
|
||||
&:last-child {
|
||||
line-height: 50rpx;
|
||||
float: right;
|
||||
color: $color-tip;
|
||||
font-size: $font-size-activity-tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.account-list-content > .edit-item + .edit-item {
|
||||
border-top: 2rpx solid $color-line;
|
||||
}
|
||||
|
||||
.add {
|
||||
margin-top: 60rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx !important;
|
||||
border-radius: 80rpx;
|
||||
font-weight: 500;
|
||||
width: calc(100% - 60rpx);
|
||||
margin-left: 30rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
bottom: 30rpx;
|
||||
height: auto;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/*兼容 IOS<11.2*/
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/*兼容 IOS>11.2*/
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="account-list-content" :style="themeColor">
|
||||
<view class="edit-item">
|
||||
<text class="tit">{{ $lang('common.list.name') }}</text>
|
||||
<input class="desc uni-input" type="text" maxlength="30" placeholder=$lang("member.account_edit.l5") name="name" v-model="formData.realname" />
|
||||
</view>
|
||||
<view class="edit-item">
|
||||
<text class="tit">{{ $lang('login.list.mobile_phone') }}</text>
|
||||
<input class="desc uni-input" type="number" maxlength="11" placeholder=$lang("common.ns-login.l16.t0") v-model="formData.mobile" />
|
||||
</view>
|
||||
<view class="edit-item">
|
||||
<text class="tit">{{ $lang('member.list.account_type') }}</text>
|
||||
<picker @change="bindPickerChange" :value="index" :range="payList" class="picker">
|
||||
<text class="desc uni-input">{{ payList[index] }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="edit-item" v-if="formData.withdraw_type == 'bank'">
|
||||
<text class="tit">{{ $lang("fenxiao.withdrawal_detail.l30") }}</text>
|
||||
<input class="desc uni-input" type="text" maxlength="50" placeholder=$lang("member.account_edit.l20") v-model.trim="formData.branch_bank_name" />
|
||||
</view>
|
||||
<view class="edit-item" v-if="formData.withdraw_type != 'wechatpay'">
|
||||
<text class="tit">{{ $lang("member.account_edit.l23") }}</text>
|
||||
<input class="desc uni-input" type="text" maxlength="30" placeholder=$lang("member.account_edit.l24") v-model.trim="formData.bank_account" />
|
||||
</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="add" @click="saveAccount">{{ $lang('common.button.save') }}</button>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import validate from 'common/js/validate.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
realname: '',
|
||||
mobile: '',
|
||||
withdraw_type: '',
|
||||
bank_account: '',
|
||||
branch_bank_name: ''
|
||||
},
|
||||
payList: [],
|
||||
index: 0,
|
||||
flag: false,
|
||||
transferType: [],
|
||||
accountInfo: null,
|
||||
back: '',
|
||||
type: 'member'
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.id) this.formData.id = option.id;
|
||||
if (option.back) this.back = option.back;
|
||||
if (option.type) this.type = option.type; // 区分是从会员提现还是从分销提现
|
||||
},
|
||||
onShow() {
|
||||
if (this.formData.id) {
|
||||
this.getAccountDetail(this.formData.id);
|
||||
} else {
|
||||
this.getTransferType();
|
||||
}
|
||||
if (this.formData.id) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: $lang('member.account_edit.l67')
|
||||
});
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: $lang('member.account_edit.l71')
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getAccountDetail(id) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/info',
|
||||
data: {
|
||||
id: this.formData.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.accountInfo = res.data;
|
||||
this.formData.realname = res.data.realname;
|
||||
this.formData.mobile = res.data.mobile;
|
||||
this.formData.bank_account = res.data.bank_account;
|
||||
this.formData.branch_bank_name = res.data.branch_bank_name;
|
||||
this.formData.withdraw_type = res.data.withdraw_type;
|
||||
}
|
||||
this.getTransferType();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
this.getTransferType();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取转账方式
|
||||
*/
|
||||
getTransferType() {
|
||||
this.payList = [];
|
||||
let url = this.type == "member" ? "/api/memberwithdraw/transferType" : "/fenxiao/api/withdraw/transferType";
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
delete res.data.balance;
|
||||
this.transferType = res.data;
|
||||
for (let v in this.transferType) {
|
||||
this.payList.push(this.transferType[v]);
|
||||
}
|
||||
|
||||
if (this.payList.length == 1 && this.payList[0] == $lang('fenxiao.withdraw_list.l12')) {
|
||||
this.formData.withdraw_type = 'bank';
|
||||
}
|
||||
|
||||
this.payList.reverse();
|
||||
if (!this.formData.id && this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
|
||||
if (this.accountInfo && this.$util.inArray(this.accountInfo.withdraw_type_name, this.payList) == -1) {
|
||||
this.payList.push(this.accountInfo.withdraw_type_name);
|
||||
}
|
||||
|
||||
if (this.payList.length && this.accountInfo) {
|
||||
this.index = this.$util.inArray(this.accountInfo.withdraw_type_name, this.payList);
|
||||
}
|
||||
|
||||
if (!this.formData.withdraw_type && this.payList.length) {
|
||||
switch (this.payList[0]) {
|
||||
case '银行卡':
|
||||
this.formData.withdraw_type = 'bank';
|
||||
break;
|
||||
case '支付宝':
|
||||
this.formData.withdraw_type = 'alipay';
|
||||
break;
|
||||
case '微信零钱':
|
||||
this.formData.withdraw_type = 'wechatpay';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
bindPickerChange(e) {
|
||||
this.index = e.detail.value;
|
||||
let value = '';
|
||||
for (let i in this.transferType) {
|
||||
if (this.transferType[i] == this.payList[this.index]) {
|
||||
value = i;
|
||||
}
|
||||
}
|
||||
if (value != '') this.formData.withdraw_type = value;
|
||||
},
|
||||
vertify() {
|
||||
var rule = [
|
||||
{
|
||||
name: 'realname',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('member.account_edit.l163')
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('common.ns-login.l16.t0')
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: $lang('common.ns-login.l393.t0')
|
||||
},
|
||||
{
|
||||
name: 'withdraw_type',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('member.account_edit.l178')
|
||||
}
|
||||
];
|
||||
if (this.formData.withdraw_type == 'bank') {
|
||||
rule.push({
|
||||
name: 'branch_bank_name',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('member.account_edit.l20')
|
||||
});
|
||||
}
|
||||
if (this.formData.withdraw_type != 'wechatpay') {
|
||||
rule.push({
|
||||
name: 'bank_account',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('member.account_edit.l24')
|
||||
});
|
||||
}
|
||||
var checkRes = validate.check(this.formData, rule);
|
||||
if (checkRes) {
|
||||
return true;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
this.flag = false;
|
||||
return false;
|
||||
}
|
||||
},
|
||||
saveAccount() {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
if (this.vertify()) {
|
||||
let url = !this.formData.id ? 'add' : 'edit';
|
||||
let data = {};
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/' + url,
|
||||
data: {
|
||||
id: this.formData.id,
|
||||
realname: this.formData.realname,
|
||||
mobile: this.formData.mobile,
|
||||
withdraw_type: this.formData.withdraw_type,
|
||||
bank_account: this.formData.bank_account,
|
||||
branch_bank_name: this.formData.branch_bank_name
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
if (!this.formData.id) {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.account_edit.l226')
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.account_edit.l230')
|
||||
});
|
||||
}
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(this.back, {}, this.redirect);
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/member/account');
|
||||
}
|
||||
} else {
|
||||
this.flag = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.account-list-content {
|
||||
margin: $margin-updown $margin-both;
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
border-radius: $border-radius;
|
||||
|
||||
.edit-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 30rpx 0;
|
||||
background-color: #fff;
|
||||
|
||||
.tit {
|
||||
width: 120rpx;
|
||||
}
|
||||
|
||||
.desc {
|
||||
flex: 1;
|
||||
margin-left: 20rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
&:first-of-type {
|
||||
margin-top: $uni-spacing-row-base;
|
||||
}
|
||||
|
||||
.picker {
|
||||
flex: 1;
|
||||
|
||||
text {
|
||||
&:last-child {
|
||||
line-height: 50rpx;
|
||||
float: right;
|
||||
color: $color-tip;
|
||||
font-size: $font-size-activity-tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.account-list-content > .edit-item + .edit-item {
|
||||
border-top: 2rpx solid $color-line;
|
||||
}
|
||||
|
||||
.add {
|
||||
margin-top: 60rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx !important;
|
||||
border-radius: 80rpx;
|
||||
font-weight: 500;
|
||||
width: calc(100% - 60rpx);
|
||||
margin-left: 30rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
bottom: 30rpx;
|
||||
height: auto;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/*兼容 IOS<11.2*/
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/*兼容 IOS>11.2*/
|
||||
}
|
||||
</style>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,497 +1,497 @@
|
||||
<template>
|
||||
<view class="address-edit-content" :style="themeColor">
|
||||
<view class="edit-wrap">
|
||||
<view class="tip">地址信息</view>
|
||||
<view class="edit-item">
|
||||
<text class="tit">
|
||||
{{ $lang('consignee') }}
|
||||
<text>*</text>
|
||||
</text>
|
||||
<input
|
||||
class="uni-input"
|
||||
type="text"
|
||||
placeholder-class="placeholder-class"
|
||||
:placeholder="$lang('consigneePlaceholder')"
|
||||
maxlength="30"
|
||||
name="name"
|
||||
v-model="formData.name" />
|
||||
</view>
|
||||
<view class="edit-item">
|
||||
<text class="tit">
|
||||
{{ $lang('mobile') }}
|
||||
<text>*</text>
|
||||
</text>
|
||||
<input class="uni-input" type="number" placeholder-class="placeholder-class" :placeholder="$lang('mobilePlaceholder')" maxlength="11" v-model="formData.mobile" />
|
||||
</view>
|
||||
<view class="edit-item">
|
||||
<text class="tit">{{ $lang('telephone') }}</text>
|
||||
<input
|
||||
class="uni-input"
|
||||
type="text"
|
||||
placeholder-class="placeholder-class"
|
||||
:placeholder="$lang('telephonePlaceholder')"
|
||||
maxlength="20"
|
||||
v-model="formData.telephone" />
|
||||
</view>
|
||||
<!-- 外卖地址区分 -->
|
||||
<block v-if="localType == 2">
|
||||
<view class="edit-item">
|
||||
<text class="tit">
|
||||
{{ $lang('receivingCity') }}
|
||||
<text>*</text>
|
||||
</text>
|
||||
<view class="text_inp" :class="{ empty: !formData.full_address, 'color-tip': !formData.full_address }" @click="selectAddress">
|
||||
{{ formData.full_address ? formData.full_address : '请选择省市区县' }}
|
||||
</view>
|
||||
|
||||
<text @click="selectAddress" class="padding-left iconfont icon-location"></text>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="edit-item">
|
||||
<text class="tit">
|
||||
{{ $lang('receivingCity') }}
|
||||
<text>*</text>
|
||||
</text>
|
||||
<pick-regions :default-regions="defaultRegions" @getRegions="handleGetRegions">
|
||||
<text class="select-address " :class="{ empty: !formData.full_address, 'color-tip': !formData.full_address }">
|
||||
{{ formData.full_address ? formData.full_address : '请选择省市区县' }}
|
||||
</text>
|
||||
</pick-regions>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view class="edit-item">
|
||||
<text class="tit" style="">
|
||||
{{ $lang('address') }}
|
||||
<text>*</text>
|
||||
</text>
|
||||
<input class="uni-input" type="text" placeholder-class="placeholder-class" :placeholder="$lang('addressPlaceholder')" maxlength="50" v-model="formData.address" />
|
||||
<!-- <textarea class="uni-input " type="text" placeholder-class="placeholder-class" :placeholder="$lang('addressPlaceholder')" maxlength="50" v-model="formData.address" ></textarea> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="add" @click="saveAddress">{{ $lang('save') }}</button>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import validate from 'common/js/validate.js';
|
||||
import Config from '@/common/js/config.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
id: 0,
|
||||
name: '',
|
||||
mobile: '',
|
||||
telephone: '',
|
||||
province_id: '',
|
||||
city_id: '',
|
||||
district_id: '',
|
||||
community_id: '',
|
||||
address: '',
|
||||
full_address: '',
|
||||
latitude: 0,
|
||||
longitude: 0,
|
||||
is_default: 1
|
||||
},
|
||||
address: '',
|
||||
addressValue: '',
|
||||
back: '', // 返回页
|
||||
redirect: 'redirectTo', // 跳转方式
|
||||
flag: false, //防重复标识
|
||||
defaultRegions: [],
|
||||
localType: 1
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
if (option.redirect) this.redirect = option.redirect;
|
||||
if (option.type) this.localType = option.type;
|
||||
if (option.id && !option.name) {
|
||||
this.formData.id = option.id;
|
||||
this.getAddressDetail();
|
||||
} else if (option.name) {
|
||||
if (uni.getStorageSync('addressInfo')) this.formData = uni.getStorageSync('addressInfo');
|
||||
this.formData.address = option.name;
|
||||
this.localType = 2;
|
||||
this.getAddress(option.latng);
|
||||
//给formData复制
|
||||
var tempArr = this.getQueryVariable('latng').split(',');
|
||||
this.formData.latitude = tempArr[0];
|
||||
this.formData.longitude = tempArr[1];
|
||||
} else {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
uni.setStorageSync('addressInfo', '');
|
||||
},
|
||||
onShow() {
|
||||
if (this.formData.id) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '编辑收货地址'
|
||||
});
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: '新增收货地址'
|
||||
});
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.loadingCover.hide();
|
||||
},
|
||||
onHide() {
|
||||
this.flag = false;
|
||||
},
|
||||
methods: {
|
||||
// 获取地址信息
|
||||
getAddressDetail() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaddress/info',
|
||||
data: {
|
||||
id: this.formData.id
|
||||
},
|
||||
success: res => {
|
||||
let data = res.data;
|
||||
if (data != null) {
|
||||
this.formData.name = data.name;
|
||||
this.formData.mobile = data.mobile;
|
||||
this.formData.telephone = data.telephone;
|
||||
this.formData.address = data.address;
|
||||
this.formData.full_address = data.full_address;
|
||||
this.formData.latitude = data.latitude;
|
||||
this.formData.longitude = data.longitude;
|
||||
this.formData.is_default = data.is_default;
|
||||
this.localType = data.type;
|
||||
this.defaultRegions = [data.province_id, data.city_id, data.district_id];
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取详细地址
|
||||
getAddress(value) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaddress/tranAddressInfo',
|
||||
data: {
|
||||
latlng: value
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.formData.full_address = '';
|
||||
this.formData.full_address += res.data.province != undefined ? res.data.province : '';
|
||||
this.formData.full_address += res.data.city != undefined ? '-' + res.data.city : '';
|
||||
this.formData.full_address += res.data.district != undefined ? '-' + res.data.district : '';
|
||||
this.addressValue = '';
|
||||
this.addressValue += res.data.province_id != undefined ? res.data.province_id : '';
|
||||
this.addressValue += res.data.city_id != undefined ? '-' + res.data.city_id : '';
|
||||
this.addressValue += res.data.district_id != undefined ? '-' + res.data.district_id : '';
|
||||
} else {
|
||||
this.showToast({
|
||||
title: '数据有误'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取选择的地区
|
||||
handleGetRegions(regions) {
|
||||
this.formData.full_address = '';
|
||||
this.formData.full_address += regions[0] != undefined ? regions[0].label : '';
|
||||
this.formData.full_address += regions[1] != undefined ? '-' + regions[1].label : '';
|
||||
this.formData.full_address += regions[2] != undefined ? '-' + regions[2].label : '';
|
||||
this.addressValue = '';
|
||||
this.addressValue += regions[0] != undefined ? regions[0].value : '';
|
||||
this.addressValue += regions[1] != undefined ? '-' + regions[1].value : '';
|
||||
this.addressValue += regions[2] != undefined ? '-' + regions[2].value : '';
|
||||
},
|
||||
|
||||
selectAddress() {
|
||||
// #ifdef MP
|
||||
/* uni.chooseLocation({
|
||||
success: res => {
|
||||
this.formData.latitude = res.latitude;
|
||||
this.formData.longitude = res.longitude;
|
||||
this.formData.address = res.name;
|
||||
this.getAddress(res.latitude + ',' + res.longitude);
|
||||
},
|
||||
fail(res) {
|
||||
uni.getSetting({
|
||||
success: function(res) {
|
||||
var statu = res.authSetting;
|
||||
if (!statu['scope.userLocation']) {
|
||||
uni.showModal({
|
||||
title: '是否授权当前位置',
|
||||
content: '需要获取您的地理位置,请确认授权,否则地图功能将无法使用',
|
||||
success(tip) {
|
||||
if (tip.confirm) {
|
||||
uni.openSetting({
|
||||
success: function (data) {
|
||||
if (data.authSetting['scope.userLocation'] === true) {
|
||||
this.$util.showToast({
|
||||
title: '授权成功'
|
||||
});
|
||||
//授权成功之后,再调用chooseLocation选择地方
|
||||
setTimeout(function () {
|
||||
uni.chooseLocation({
|
||||
success: data => {
|
||||
this.formData.latitude = res.latitude;
|
||||
this.formData.longitude = res.longitude;
|
||||
this.formData.address = res.name;
|
||||
this.getAddress(res.latitude + ',' + res.longitude);
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '授权失败'
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});*/
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
var urlencode = this.formData;
|
||||
uni.setStorageSync('addressInfo', urlencode);
|
||||
let backurl = Config.h5Domain + '/pages_tool/member/address_edit?type=' + this.localType;
|
||||
if (this.formData.id) backurl += '&id=' + this.formData.id;
|
||||
if (this.back) backurl += '&back=' + this.back;
|
||||
|
||||
window.location.href = 'https://apis.map.qq.com/tools/locpicker?search=1&type=0&backurl=' + encodeURIComponent(backurl) + '&key=' + Config.mpKey + '&referer=myapp';
|
||||
// #endif
|
||||
},
|
||||
|
||||
getQueryVariable(variable) {
|
||||
var query = window.location.search.substring(1);
|
||||
var vars = query.split('&');
|
||||
for (var i = 0; i < vars.length; i++) {
|
||||
var pair = vars[i].split('=');
|
||||
if (pair[0] == variable) {
|
||||
return pair[1];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
vertify() {
|
||||
this.formData.name = this.formData.name.trim();
|
||||
this.formData.mobile = this.formData.mobile.trim();
|
||||
this.formData.address = this.formData.address.trim();
|
||||
var rule = [{
|
||||
name: 'name',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入姓名'
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: '请输入手机号'
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: '请输入正确的手机号'
|
||||
},
|
||||
{
|
||||
name: 'full_address',
|
||||
checkType: 'required',
|
||||
errorMsg: '请选择省市区县'
|
||||
},
|
||||
{
|
||||
name: 'address',
|
||||
checkType: 'required',
|
||||
errorMsg: '详细地址不能为空'
|
||||
}
|
||||
];
|
||||
var checkRes = validate.check(this.formData, rule);
|
||||
if (checkRes) {
|
||||
return true;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
this.flag = false;
|
||||
return false;
|
||||
}
|
||||
},
|
||||
saveAddress() {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
if (this.vertify()) {
|
||||
let addressValueArr = this.addressValue.split('-'),
|
||||
data = {},
|
||||
url = '';
|
||||
|
||||
data = {
|
||||
name: this.formData.name,
|
||||
mobile: this.formData.mobile,
|
||||
telephone: this.formData.telephone,
|
||||
province_id: addressValueArr[0],
|
||||
city_id: addressValueArr[1],
|
||||
district_id: addressValueArr[2] ? addressValueArr[2] : '',
|
||||
community_id: 0,
|
||||
address: this.formData.address,
|
||||
full_address: this.formData.full_address,
|
||||
latitude: this.formData.latitude,
|
||||
longitude: this.formData.longitude,
|
||||
is_default: this.formData.is_default,
|
||||
type: this.localType
|
||||
};
|
||||
|
||||
url = 'add';
|
||||
if (this.formData.id) {
|
||||
url = 'edit';
|
||||
data.id = this.formData.id;
|
||||
if (this.back != '') data.is_default = 1;
|
||||
}
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaddress/' + url,
|
||||
data: data,
|
||||
success: res => {
|
||||
this.flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(this.back, {}, 'redirectTo');
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
uni.removeStorageSync('addressInfo');
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep pick-regions,
|
||||
.pick-regions {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.edit-wrap {
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
|
||||
.tip {
|
||||
padding: 20rpx 30rpx 10rpx;
|
||||
background-color: #f8f8f8;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.edit-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0 30rpx;
|
||||
min-height: 100rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.text_inp {
|
||||
margin-left: $margin-updown;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tit {
|
||||
width: 148rpx;
|
||||
|
||||
text {
|
||||
margin-left: 10rpx;
|
||||
color: #ff4544;
|
||||
}
|
||||
|
||||
&.margin_tit {
|
||||
align-self: flex-start;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-location {
|
||||
color: #606266;
|
||||
align-self: flex-start;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.select-address {
|
||||
display: block;
|
||||
margin-left: 10rpx;
|
||||
|
||||
&.empty {
|
||||
color: #808080;
|
||||
}
|
||||
}
|
||||
|
||||
textarea,
|
||||
input {
|
||||
flex: 1;
|
||||
font-size: $font-size-base;
|
||||
margin-left: 20rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
textarea {
|
||||
margin-top: 6rpx;
|
||||
height: 100rpx;
|
||||
padding-bottom: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.edit-wrap>.edit-item+.edit-item {
|
||||
border-top: 2rpx solid #ebedf0;
|
||||
}
|
||||
|
||||
.add {
|
||||
margin-top: 60rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx !important;
|
||||
border-radius: 80rpx;
|
||||
font-weight: 500;
|
||||
width: calc(100% - 60rpx);
|
||||
margin-left: 30rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
bottom: 30rpx;
|
||||
height: auto;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/*兼容 IOS<11.2*/
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/*兼容 IOS>11.2*/
|
||||
}
|
||||
<template>
|
||||
<view class="address-edit-content" :style="themeColor">
|
||||
<view class="edit-wrap">
|
||||
<view class="tip">{{ $lang("member.address_edit.l4") }}</view>
|
||||
<view class="edit-item">
|
||||
<text class="tit">
|
||||
{{ $lang('member.list.consignee') }}
|
||||
<text>*</text>
|
||||
</text>
|
||||
<input
|
||||
class="uni-input"
|
||||
type="text"
|
||||
placeholder-class="placeholder-class"
|
||||
:placeholder="$lang('member.list.consignee_placeholder')"
|
||||
maxlength="30"
|
||||
name="name"
|
||||
v-model="formData.name" />
|
||||
</view>
|
||||
<view class="edit-item">
|
||||
<text class="tit">
|
||||
{{ $lang('login.list.mobile') }}
|
||||
<text>*</text>
|
||||
</text>
|
||||
<input class="uni-input" type="number" placeholder-class="placeholder-class" :placeholder="$lang('login.list.mobile_placeholder')" maxlength="11" v-model="formData.mobile" />
|
||||
</view>
|
||||
<view class="edit-item">
|
||||
<text class="tit">{{ $lang('login.list.telephone') }}</text>
|
||||
<input
|
||||
class="uni-input"
|
||||
type="text"
|
||||
placeholder-class="placeholder-class"
|
||||
:placeholder="$lang('login.list.telephone_placeholder')"
|
||||
maxlength="20"
|
||||
v-model="formData.telephone" />
|
||||
</view>
|
||||
<!-- 外卖地址区分 -->
|
||||
<block v-if="localType == 2">
|
||||
<view class="edit-item">
|
||||
<text class="tit">
|
||||
{{ $lang('common.list.receiving_city') }}
|
||||
<text>*</text>
|
||||
</text>
|
||||
<view class="text_inp" :class="{ empty: !formData.full_address, 'color-tip': !formData.full_address }" @click="selectAddress">
|
||||
{{ formData.full_address ? formData.full_address : $lang('member.address_edit.l44') }}
|
||||
</view>
|
||||
|
||||
<text @click="selectAddress" class="padding-left iconfont icon-location"></text>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="edit-item">
|
||||
<text class="tit">
|
||||
{{ $lang('common.list.receiving_city') }}
|
||||
<text>*</text>
|
||||
</text>
|
||||
<pick-regions :default-regions="defaultRegions" @getRegions="handleGetRegions">
|
||||
<text class="select-address " :class="{ empty: !formData.full_address, 'color-tip': !formData.full_address }">
|
||||
{{ formData.full_address ? formData.full_address : $lang('member.address_edit.l44') }}
|
||||
</text>
|
||||
</pick-regions>
|
||||
</view>
|
||||
</block>
|
||||
|
||||
<view class="edit-item">
|
||||
<text class="tit" style="">
|
||||
{{ $lang('address') }}
|
||||
<text>*</text>
|
||||
</text>
|
||||
<input class="uni-input" type="text" placeholder-class="placeholder-class" :placeholder="$lang('member.list.address_placeholder')" maxlength="50" v-model="formData.address" />
|
||||
<!-- <textarea class="uni-input " type="text" placeholder-class="placeholder-class" :placeholder="$lang('member.list.address_placeholder')" maxlength="50" v-model="formData.address" ></textarea> -->
|
||||
</view>
|
||||
</view>
|
||||
<view class="btn">
|
||||
<button type="primary" class="add" @click="saveAddress">{{ $lang('common.button.save') }}</button>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import validate from 'common/js/validate.js';
|
||||
import Config from '@/common/js/config.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
id: 0,
|
||||
name: '',
|
||||
mobile: '',
|
||||
telephone: '',
|
||||
province_id: '',
|
||||
city_id: '',
|
||||
district_id: '',
|
||||
community_id: '',
|
||||
address: '',
|
||||
full_address: '',
|
||||
latitude: 0,
|
||||
longitude: 0,
|
||||
is_default: 1
|
||||
},
|
||||
address: '',
|
||||
addressValue: '',
|
||||
back: '', // 返回页
|
||||
redirect: 'redirectTo', // 跳转方式
|
||||
flag: false, //防重复标识
|
||||
defaultRegions: [],
|
||||
localType: 1
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
if (option.redirect) this.redirect = option.redirect;
|
||||
if (option.type) this.localType = option.type;
|
||||
if (option.id && !option.name) {
|
||||
this.formData.id = option.id;
|
||||
this.getAddressDetail();
|
||||
} else if (option.name) {
|
||||
if (uni.getStorageSync('addressInfo')) this.formData = uni.getStorageSync('addressInfo');
|
||||
this.formData.address = option.name;
|
||||
this.localType = 2;
|
||||
this.getAddress(option.latng);
|
||||
//给formData复制
|
||||
var tempArr = this.getQueryVariable('latng').split(',');
|
||||
this.formData.latitude = tempArr[0];
|
||||
this.formData.longitude = tempArr[1];
|
||||
} else {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
},
|
||||
onBackPress() {
|
||||
uni.setStorageSync('addressInfo', '');
|
||||
},
|
||||
onShow() {
|
||||
if (this.formData.id) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: $lang('member.address_edit.l138')
|
||||
});
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: $lang('member.address_edit.l142')
|
||||
});
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
this.$refs.loadingCover.hide();
|
||||
},
|
||||
onHide() {
|
||||
this.flag = false;
|
||||
},
|
||||
methods: {
|
||||
// 获取地址信息
|
||||
getAddressDetail() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaddress/info',
|
||||
data: {
|
||||
id: this.formData.id
|
||||
},
|
||||
success: res => {
|
||||
let data = res.data;
|
||||
if (data != null) {
|
||||
this.formData.name = data.name;
|
||||
this.formData.mobile = data.mobile;
|
||||
this.formData.telephone = data.telephone;
|
||||
this.formData.address = data.address;
|
||||
this.formData.full_address = data.full_address;
|
||||
this.formData.latitude = data.latitude;
|
||||
this.formData.longitude = data.longitude;
|
||||
this.formData.is_default = data.is_default;
|
||||
this.localType = data.type;
|
||||
this.defaultRegions = [data.province_id, data.city_id, data.district_id];
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//获取详细地址
|
||||
getAddress(value) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaddress/tranAddressInfo',
|
||||
data: {
|
||||
latlng: value
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.formData.full_address = '';
|
||||
this.formData.full_address += res.data.province != undefined ? res.data.province : '';
|
||||
this.formData.full_address += res.data.city != undefined ? '-' + res.data.city : '';
|
||||
this.formData.full_address += res.data.district != undefined ? '-' + res.data.district : '';
|
||||
this.addressValue = '';
|
||||
this.addressValue += res.data.province_id != undefined ? res.data.province_id : '';
|
||||
this.addressValue += res.data.city_id != undefined ? '-' + res.data.city_id : '';
|
||||
this.addressValue += res.data.district_id != undefined ? '-' + res.data.district_id : '';
|
||||
} else {
|
||||
this.showToast({
|
||||
title: $lang('member.address_edit.l200')
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取选择的地区
|
||||
handleGetRegions(regions) {
|
||||
this.formData.full_address = '';
|
||||
this.formData.full_address += regions[0] != undefined ? regions[0].label : '';
|
||||
this.formData.full_address += regions[1] != undefined ? '-' + regions[1].label : '';
|
||||
this.formData.full_address += regions[2] != undefined ? '-' + regions[2].label : '';
|
||||
this.addressValue = '';
|
||||
this.addressValue += regions[0] != undefined ? regions[0].value : '';
|
||||
this.addressValue += regions[1] != undefined ? '-' + regions[1].value : '';
|
||||
this.addressValue += regions[2] != undefined ? '-' + regions[2].value : '';
|
||||
},
|
||||
|
||||
selectAddress() {
|
||||
// #ifdef MP
|
||||
/* uni.chooseLocation({
|
||||
success: res => {
|
||||
this.formData.latitude = res.latitude;
|
||||
this.formData.longitude = res.longitude;
|
||||
this.formData.address = res.name;
|
||||
this.getAddress(res.latitude + ',' + res.longitude);
|
||||
},
|
||||
fail(res) {
|
||||
uni.getSetting({
|
||||
success: function(res) {
|
||||
var statu = res.authSetting;
|
||||
if (!statu['scope.userLocation']) {
|
||||
uni.showModal({
|
||||
title: $lang('member.address_edit.l233'),
|
||||
content: $lang('member.address_edit.l234'),
|
||||
success(tip) {
|
||||
if (tip.confirm) {
|
||||
uni.openSetting({
|
||||
success: function (data) {
|
||||
if (data.authSetting['scope.userLocation'] === true) {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.address_edit.l241')
|
||||
});
|
||||
//授权成功之后,再调用chooseLocation选择地方
|
||||
setTimeout(function () {
|
||||
uni.chooseLocation({
|
||||
success: data => {
|
||||
this.formData.latitude = res.latitude;
|
||||
this.formData.longitude = res.longitude;
|
||||
this.formData.address = res.name;
|
||||
this.getAddress(res.latitude + ',' + res.longitude);
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.address_edit.l259')
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});*/
|
||||
// #endif
|
||||
// #ifdef H5
|
||||
var urlencode = this.formData;
|
||||
uni.setStorageSync('addressInfo', urlencode);
|
||||
let backurl = Config.h5Domain + '/pages_tool/member/address_edit?type=' + this.localType;
|
||||
if (this.formData.id) backurl += '&id=' + this.formData.id;
|
||||
if (this.back) backurl += '&back=' + this.back;
|
||||
|
||||
window.location.href = 'https://apis.map.qq.com/tools/locpicker?search=1&type=0&backurl=' + encodeURIComponent(backurl) + '&key=' + Config.mpKey + '&referer=myapp';
|
||||
// #endif
|
||||
},
|
||||
|
||||
getQueryVariable(variable) {
|
||||
var query = window.location.search.substring(1);
|
||||
var vars = query.split('&');
|
||||
for (var i = 0; i < vars.length; i++) {
|
||||
var pair = vars[i].split('=');
|
||||
if (pair[0] == variable) {
|
||||
return pair[1];
|
||||
}
|
||||
}
|
||||
return false;
|
||||
},
|
||||
vertify() {
|
||||
this.formData.name = this.formData.name.trim();
|
||||
this.formData.mobile = this.formData.mobile.trim();
|
||||
this.formData.address = this.formData.address.trim();
|
||||
var rule = [{
|
||||
name: 'name',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('member.account_edit.l163')
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('common.ns-login.l16.t0')
|
||||
},
|
||||
{
|
||||
name: 'mobile',
|
||||
checkType: 'phoneno',
|
||||
errorMsg: $lang('common.ns-login.l393.t0')
|
||||
},
|
||||
{
|
||||
name: 'full_address',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('member.address_edit.l44')
|
||||
},
|
||||
{
|
||||
name: 'address',
|
||||
checkType: 'required',
|
||||
errorMsg: $lang('member.address_edit.l319')
|
||||
}
|
||||
];
|
||||
var checkRes = validate.check(this.formData, rule);
|
||||
if (checkRes) {
|
||||
return true;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: validate.error
|
||||
});
|
||||
this.flag = false;
|
||||
return false;
|
||||
}
|
||||
},
|
||||
saveAddress() {
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
if (this.vertify()) {
|
||||
let addressValueArr = this.addressValue.split('-'),
|
||||
data = {},
|
||||
url = '';
|
||||
|
||||
data = {
|
||||
name: this.formData.name,
|
||||
mobile: this.formData.mobile,
|
||||
telephone: this.formData.telephone,
|
||||
province_id: addressValueArr[0],
|
||||
city_id: addressValueArr[1],
|
||||
district_id: addressValueArr[2] ? addressValueArr[2] : '',
|
||||
community_id: 0,
|
||||
address: this.formData.address,
|
||||
full_address: this.formData.full_address,
|
||||
latitude: this.formData.latitude,
|
||||
longitude: this.formData.longitude,
|
||||
is_default: this.formData.is_default,
|
||||
type: this.localType
|
||||
};
|
||||
|
||||
url = 'add';
|
||||
if (this.formData.id) {
|
||||
url = 'edit';
|
||||
data.id = this.formData.id;
|
||||
if (this.back != '') data.is_default = 1;
|
||||
}
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaddress/' + url,
|
||||
data: data,
|
||||
success: res => {
|
||||
this.flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(this.back, {}, 'redirectTo');
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
uni.navigateBack({
|
||||
delta: 1
|
||||
});
|
||||
}
|
||||
uni.removeStorageSync('addressInfo');
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep pick-regions,
|
||||
.pick-regions {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.edit-wrap {
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
|
||||
.tip {
|
||||
padding: 20rpx 30rpx 10rpx;
|
||||
background-color: #f8f8f8;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.edit-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 0 30rpx;
|
||||
min-height: 100rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.text_inp {
|
||||
margin-left: $margin-updown;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.tit {
|
||||
width: 148rpx;
|
||||
|
||||
text {
|
||||
margin-left: 10rpx;
|
||||
color: #ff4544;
|
||||
}
|
||||
|
||||
&.margin_tit {
|
||||
align-self: flex-start;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-location {
|
||||
color: #606266;
|
||||
align-self: flex-start;
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.select-address {
|
||||
display: block;
|
||||
margin-left: 10rpx;
|
||||
|
||||
&.empty {
|
||||
color: #808080;
|
||||
}
|
||||
}
|
||||
|
||||
textarea,
|
||||
input {
|
||||
flex: 1;
|
||||
font-size: $font-size-base;
|
||||
margin-left: 20rpx;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
textarea {
|
||||
margin-top: 6rpx;
|
||||
height: 100rpx;
|
||||
padding-bottom: 20rpx;
|
||||
padding-top: 20rpx;
|
||||
line-height: 50rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.edit-wrap>.edit-item+.edit-item {
|
||||
border-top: 2rpx solid #ebedf0;
|
||||
}
|
||||
|
||||
.add {
|
||||
margin-top: 60rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx !important;
|
||||
border-radius: 80rpx;
|
||||
font-weight: 500;
|
||||
width: calc(100% - 60rpx);
|
||||
margin-left: 30rpx;
|
||||
font-size: 32rpx;
|
||||
}
|
||||
|
||||
.btn {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
bottom: 30rpx;
|
||||
height: auto;
|
||||
padding-bottom: constant(safe-area-inset-bottom);
|
||||
/*兼容 IOS<11.2*/
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
/*兼容 IOS>11.2*/
|
||||
}
|
||||
</style>
|
||||
@@ -1,424 +1,424 @@
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="bank-account-wrap" @click="goAccount()">
|
||||
<view class="tx-wrap" v-if="bankAccountInfo.withdraw_type">
|
||||
<text class="tx-to">提现到</text>
|
||||
<view class="tx-bank" v-if="bankAccountInfo.withdraw_type == 'wechatpay'">微信默认钱包</view>
|
||||
<view class="tx-bank" v-else>{{ bankAccountInfo.bank_account }}</view>
|
||||
<view class="tx-img" v-if="bankAccountInfo.withdraw_type == 'alipay'">
|
||||
<image :src="$util.img('public/uniapp/member/apply_withdrawal/alipay.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="tx-img" v-else-if="bankAccountInfo.withdraw_type == 'bank'">
|
||||
<image :src="$util.img('public/uniapp/member/apply_withdrawal/bank.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="tx-img" v-else-if="bankAccountInfo.withdraw_type == 'wechatpay'">
|
||||
<image :src="$util.img('public/uniapp/member/apply_withdrawal/wechatpay.png')" mode="widthFix" show-menu-by-longpress>
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<text class="tx-to" v-else>请添加提现方式</text>
|
||||
<view class="iconfont icon-right"></view>
|
||||
</view>
|
||||
<view class="empty-box"></view>
|
||||
<view class="withdraw-wrap">
|
||||
<view class="withdraw-wrap-title">提现金额</view>
|
||||
<view class="money-wrap">
|
||||
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
|
||||
<input type="digit" class="withdraw-money" v-model="withdrawMoney" />
|
||||
<view class="delete" @click="remove" v-if="withdrawMoney">
|
||||
<image :src="$util.img('public/uniapp/member/apply_withdrawal/close.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bootom">
|
||||
<view>
|
||||
<text class="color-tip">可提现余额:{{ $lang('common.currencySymbol') }}{{ withdrawInfo.member_info.balance_money | moneyFormat }}</text>
|
||||
<text class="all-tx color-base-text" @click="allTx">全部提现</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<text>最小提现金额为{{ $lang('common.currencySymbol') }}{{ withdrawInfo.config.min | moneyFormat }}</text>
|
||||
<text>,手续费为{{ withdrawInfo.config.rate + '%' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn color-base-border ns-gradient-otherpages-member-widthdrawal-withdrawal" :class="{ disabled: withdrawMoney == '' || withdrawMoney == 0 }" @click="withdraw">
|
||||
提现
|
||||
</view>
|
||||
|
||||
<view class="recoend" @click="toWithdrawal">
|
||||
<view class="recoend-con">提现记录</view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
withdrawInfo: {
|
||||
config: {
|
||||
is_use: 0,
|
||||
min: 1,
|
||||
rate: 0
|
||||
},
|
||||
member_info: {
|
||||
balance_money: 0,
|
||||
balance_withdraw: 0,
|
||||
balance_withdraw_apply: 0
|
||||
}
|
||||
},
|
||||
bankAccountInfo: {},
|
||||
withdrawMoney: '',
|
||||
isSub: false
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
this.getWithdrawInfo();
|
||||
this.getBankAccountInfo();
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||
back: '/pages_tool/member/apply_withdrawal'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toWithdrawal() {
|
||||
this.$util.redirectTo('/pages_tool/member/withdrawal');
|
||||
},
|
||||
//全部提现
|
||||
allTx() {
|
||||
this.withdrawMoney = this.withdrawInfo.member_info.balance_money;
|
||||
},
|
||||
// 删除提现金额
|
||||
remove() {
|
||||
this.withdrawMoney = '';
|
||||
},
|
||||
/**
|
||||
* 获取提现信息
|
||||
*/
|
||||
getWithdrawInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/info',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.withdrawInfo = res.data;
|
||||
if (this.withdrawInfo.config.is_use == 0) {
|
||||
this.$util.showToast({
|
||||
title: '未开启提现'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 银行账号信息
|
||||
*/
|
||||
getBankAccountInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/defaultinfo',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.bankAccountInfo = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
verify() {
|
||||
if (this.withdrawMoney == '' || this.withdrawMoney == 0 || isNaN(parseFloat(this.withdrawMoney))) {
|
||||
this.$util.showToast({
|
||||
title: '请输入提现金额'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (parseFloat(this.withdrawMoney) > parseFloat(this.withdrawInfo.member_info.balance_money)) {
|
||||
this.$util.showToast({
|
||||
title: '提现金额超出可提现金额'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (parseFloat(this.withdrawMoney) < parseFloat(this.withdrawInfo.config.min)) {
|
||||
this.$util.showToast({
|
||||
title: '提现金额小于最低提现金额'
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
withdraw() {
|
||||
if (!this.bankAccountInfo.withdraw_type) {
|
||||
this.$util.showToast({
|
||||
title: '请先添加提现方式'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.verify()) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
var applet_type = 0;
|
||||
if (this.bankAccountInfo.withdraw_type == 'wechatpay') {
|
||||
// #ifdef MP
|
||||
applet_type = 1;
|
||||
// #endif
|
||||
}
|
||||
|
||||
// #ifdef MP
|
||||
this.subscribeMessage(() => {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/apply',
|
||||
data: {
|
||||
apply_money: this.withdrawMoney,
|
||||
transfer_type: this.bankAccountInfo.withdraw_type, //转账提现类型
|
||||
realname: this.bankAccountInfo.realname,
|
||||
mobile: this.bankAccountInfo.mobile,
|
||||
bank_name: this.bankAccountInfo.branch_bank_name,
|
||||
account_number: this.bankAccountInfo.bank_account,
|
||||
applet_type: applet_type
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: '提现申请成功'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(
|
||||
'/pages_tool/member/withdrawal', {},
|
||||
'redirectTo');
|
||||
}, 1500);
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/apply',
|
||||
data: {
|
||||
apply_money: this.withdrawMoney,
|
||||
transfer_type: this.bankAccountInfo.withdraw_type, //转账提现类型
|
||||
realname: this.bankAccountInfo.realname,
|
||||
mobile: this.bankAccountInfo.mobile,
|
||||
bank_name: this.bankAccountInfo.branch_bank_name,
|
||||
account_number: this.bankAccountInfo.bank_account,
|
||||
applet_type: applet_type
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: '提现申请成功'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_tool/member/withdrawal', {},
|
||||
'redirectTo');
|
||||
}, 1500);
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
goAccount() {
|
||||
this.$util.redirectTo(
|
||||
'/pages_tool/member/account', {
|
||||
back: '/pages_tool/member/apply_withdrawal'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
},
|
||||
/**
|
||||
* 微信订阅消息
|
||||
*/
|
||||
subscribeMessage(callback) {
|
||||
this.$api.sendRequest({
|
||||
url: '/weapp/api/weapp/messagetmplids',
|
||||
data: {
|
||||
keywords: 'USER_WITHDRAWAL_SUCCESS'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data.length) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: res.data,
|
||||
fail: res => {
|
||||
},
|
||||
complete: () => {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.empty-box {
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.bank-account-wrap {
|
||||
margin: 0 20rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 2rpx solid #f7f7f7;
|
||||
position: relative;
|
||||
|
||||
.tx-wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-right: 60rpx;
|
||||
|
||||
.tx-bank {
|
||||
margin-right: 60rpx;
|
||||
flex: 1;
|
||||
margin-left: 10rpx;
|
||||
text-align: right;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tx-img {
|
||||
position: absolute;
|
||||
right: 100rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.withdraw-wrap {
|
||||
margin: 0 20rpx;
|
||||
padding: 30rpx;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: rgba(110, 110, 110, 0.09) 0 0 20rpx 0;
|
||||
|
||||
.money-wrap {
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
|
||||
.unit {
|
||||
font-size: 60rpx;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.withdraw-money {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
min-height: 70rpx;
|
||||
padding-left: 20rpx;
|
||||
font-size: 60rpx;
|
||||
flex: 1;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.delete {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bootom {
|
||||
display: flex;
|
||||
padding-top: 20rpx;
|
||||
|
||||
text {
|
||||
line-height: 1;
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.all-tx {
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 0 30rpx;
|
||||
margin-top: 60rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: $border-radius;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background-color: var(--main-color);
|
||||
|
||||
&.disabled {
|
||||
background: #ccc;
|
||||
border-color: #ccc;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.recoend {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.recoend-con {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
font-size: $font-size-tag;
|
||||
color: #999;
|
||||
}
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="bank-account-wrap" @click="goAccount()">
|
||||
<view class="tx-wrap" v-if="bankAccountInfo.withdraw_type">
|
||||
<text class="tx-to">{{ $lang("fenxiao.withdraw_apply.l5") }}</text>
|
||||
<view class="tx-bank" v-if="bankAccountInfo.withdraw_type == 'wechatpay'">{{ $lang("fenxiao.withdraw_apply.l6") }}</view>
|
||||
<view class="tx-bank" v-else>{{ bankAccountInfo.bank_account }}</view>
|
||||
<view class="tx-img" v-if="bankAccountInfo.withdraw_type == 'alipay'">
|
||||
<image :src="$util.img('public/uniapp/member/apply_withdrawal/alipay.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="tx-img" v-else-if="bankAccountInfo.withdraw_type == 'bank'">
|
||||
<image :src="$util.img('public/uniapp/member/apply_withdrawal/bank.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="tx-img" v-else-if="bankAccountInfo.withdraw_type == 'wechatpay'">
|
||||
<image :src="$util.img('public/uniapp/member/apply_withdrawal/wechatpay.png')" mode="widthFix" show-menu-by-longpress>
|
||||
</image>
|
||||
</view>
|
||||
</view>
|
||||
<text class="tx-to" v-else>{{ $lang("member.apply_withdrawal.l19") }}</text>
|
||||
<view class="iconfont icon-right"></view>
|
||||
</view>
|
||||
<view class="empty-box"></view>
|
||||
<view class="withdraw-wrap">
|
||||
<view class="withdraw-wrap-title">{{ $lang("member.apply_withdrawal.l24") }}</view>
|
||||
<view class="money-wrap">
|
||||
<text class="unit">{{ $lang('common.currency_symbol') }}</text>
|
||||
<input type="digit" class="withdraw-money" v-model="withdrawMoney" />
|
||||
<view class="delete" @click="remove" v-if="withdrawMoney">
|
||||
<image :src="$util.img('public/uniapp/member/apply_withdrawal/close.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="bootom">
|
||||
<view>
|
||||
<text class="color-tip">{ $lang("member.apply_withdrawal.l34") } $lang('common.currency_symbol') }}{{ withdrawInfo.member_info.balance_money | moneyFormat }}</text>
|
||||
<text class="all-tx color-base-text" @click="allTx">{{ $lang("fenxiao.withdraw_apply.l42") }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<text>{ $lang("fenxiao.withdraw_apply.l46") } $lang('common.currency_symbol') }}{{ withdrawInfo.config.min | moneyFormat }}</text>
|
||||
<text>{ $lang("member.apply_withdrawal.l40") } withdrawInfo.config.rate + '%' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="btn color-base-border ns-gradient-otherpages-member-widthdrawal-withdrawal" :class="{ disabled: withdrawMoney == '' || withdrawMoney == 0 }" @click="withdraw">
|
||||
提现
|
||||
</view>
|
||||
|
||||
<view class="recoend" @click="toWithdrawal">
|
||||
<view class="recoend-con">{{ $lang("fenxiao.withdraw_apply.l64") }}</view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
withdrawInfo: {
|
||||
config: {
|
||||
is_use: 0,
|
||||
min: 1,
|
||||
rate: 0
|
||||
},
|
||||
member_info: {
|
||||
balance_money: 0,
|
||||
balance_withdraw: 0,
|
||||
balance_withdraw_apply: 0
|
||||
}
|
||||
},
|
||||
bankAccountInfo: {},
|
||||
withdrawMoney: '',
|
||||
isSub: false
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
this.getWithdrawInfo();
|
||||
this.getBankAccountInfo();
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||
back: '/pages_tool/member/apply_withdrawal'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
toWithdrawal() {
|
||||
this.$util.redirectTo('/pages_tool/member/withdrawal');
|
||||
},
|
||||
//全部提现
|
||||
allTx() {
|
||||
this.withdrawMoney = this.withdrawInfo.member_info.balance_money;
|
||||
},
|
||||
// 删除提现金额
|
||||
remove() {
|
||||
this.withdrawMoney = '';
|
||||
},
|
||||
/**
|
||||
* 获取提现信息
|
||||
*/
|
||||
getWithdrawInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/info',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.withdrawInfo = res.data;
|
||||
if (this.withdrawInfo.config.is_use == 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.apply_withdrawal.l109')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}, 1500);
|
||||
}
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 银行账号信息
|
||||
*/
|
||||
getBankAccountInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberbankaccount/defaultinfo',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.bankAccountInfo = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
verify() {
|
||||
if (this.withdrawMoney == '' || this.withdrawMoney == 0 || isNaN(parseFloat(this.withdrawMoney))) {
|
||||
this.$util.showToast({
|
||||
title: $lang('fenxiao.withdraw_apply.l178')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (parseFloat(this.withdrawMoney) > parseFloat(this.withdrawInfo.member_info.balance_money)) {
|
||||
this.$util.showToast({
|
||||
title: $lang('fenxiao.withdraw_apply.l189')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (parseFloat(this.withdrawMoney) < parseFloat(this.withdrawInfo.config.min)) {
|
||||
this.$util.showToast({
|
||||
title: $lang('fenxiao.withdraw_apply.l196')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
withdraw() {
|
||||
if (!this.bankAccountInfo.withdraw_type) {
|
||||
this.$util.showToast({
|
||||
title: $lang('fenxiao.withdraw_apply.l205')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.verify()) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
var applet_type = 0;
|
||||
if (this.bankAccountInfo.withdraw_type == 'wechatpay') {
|
||||
// #ifdef MP
|
||||
applet_type = 1;
|
||||
// #endif
|
||||
}
|
||||
|
||||
// #ifdef MP
|
||||
this.subscribeMessage(() => {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/apply',
|
||||
data: {
|
||||
apply_money: this.withdrawMoney,
|
||||
transfer_type: this.bankAccountInfo.withdraw_type, //转账提现类型
|
||||
realname: this.bankAccountInfo.realname,
|
||||
mobile: this.bankAccountInfo.mobile,
|
||||
bank_name: this.bankAccountInfo.branch_bank_name,
|
||||
account_number: this.bankAccountInfo.bank_account,
|
||||
applet_type: applet_type
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang('fenxiao.withdraw_apply.l238')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(
|
||||
'/pages_tool/member/withdrawal', {},
|
||||
'redirectTo');
|
||||
}, 1500);
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/apply',
|
||||
data: {
|
||||
apply_money: this.withdrawMoney,
|
||||
transfer_type: this.bankAccountInfo.withdraw_type, //转账提现类型
|
||||
realname: this.bankAccountInfo.realname,
|
||||
mobile: this.bankAccountInfo.mobile,
|
||||
bank_name: this.bankAccountInfo.branch_bank_name,
|
||||
account_number: this.bankAccountInfo.bank_account,
|
||||
applet_type: applet_type
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang('fenxiao.withdraw_apply.l238')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_tool/member/withdrawal', {},
|
||||
'redirectTo');
|
||||
}, 1500);
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
goAccount() {
|
||||
this.$util.redirectTo(
|
||||
'/pages_tool/member/account', {
|
||||
back: '/pages_tool/member/apply_withdrawal'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
},
|
||||
/**
|
||||
* 微信订阅消息
|
||||
*/
|
||||
subscribeMessage(callback) {
|
||||
this.$api.sendRequest({
|
||||
url: '/weapp/api/weapp/messagetmplids',
|
||||
data: {
|
||||
keywords: 'USER_WITHDRAWAL_SUCCESS'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data.length) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: res.data,
|
||||
fail: res => {
|
||||
},
|
||||
complete: () => {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
}
|
||||
|
||||
.empty-box {
|
||||
height: 20rpx;
|
||||
}
|
||||
|
||||
.bank-account-wrap {
|
||||
margin: 0 20rpx;
|
||||
padding: 20rpx 30rpx;
|
||||
border-bottom: 2rpx solid #f7f7f7;
|
||||
position: relative;
|
||||
|
||||
.tx-wrap {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
margin-right: 60rpx;
|
||||
|
||||
.tx-bank {
|
||||
margin-right: 60rpx;
|
||||
flex: 1;
|
||||
margin-left: 10rpx;
|
||||
text-align: right;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tx-img {
|
||||
position: absolute;
|
||||
right: 100rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
position: absolute;
|
||||
right: 40rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
}
|
||||
}
|
||||
|
||||
.withdraw-wrap {
|
||||
margin: 0 20rpx;
|
||||
padding: 30rpx;
|
||||
border-radius: 16rpx;
|
||||
box-shadow: rgba(110, 110, 110, 0.09) 0 0 20rpx 0;
|
||||
|
||||
.money-wrap {
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
display: flex;
|
||||
align-items: baseline;
|
||||
|
||||
.unit {
|
||||
font-size: 60rpx;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.withdraw-money {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
min-height: 70rpx;
|
||||
padding-left: 20rpx;
|
||||
font-size: 60rpx;
|
||||
flex: 1;
|
||||
font-weight: bolder;
|
||||
}
|
||||
|
||||
.delete {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.bootom {
|
||||
display: flex;
|
||||
padding-top: 20rpx;
|
||||
|
||||
text {
|
||||
line-height: 1;
|
||||
flex: 2;
|
||||
}
|
||||
|
||||
.all-tx {
|
||||
padding-left: 10rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 0 30rpx;
|
||||
margin-top: 60rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: $border-radius;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
background-color: var(--main-color);
|
||||
|
||||
&.disabled {
|
||||
background: #ccc;
|
||||
border-color: #ccc;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.recoend {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.recoend-con {
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
|
||||
.desc {
|
||||
font-size: $font-size-tag;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
@@ -1,234 +1,234 @@
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="assets-wrap">
|
||||
<view class="assets-block">
|
||||
<view class="assets-tips"><text>风险提示:确认申请后您的资产将被清空且不可找回!</text></view>
|
||||
<view class="assets-box assets-account">
|
||||
<view class="assets-title">
|
||||
<text class="color-base-bg"></text>
|
||||
<text>账户资产</text>
|
||||
</view>
|
||||
<view class="assets-list">
|
||||
<view class="assets-li">
|
||||
<view>{{ member_info.point }}</view>
|
||||
<view>积分</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>¥{{ member_info.balance_money }}</view>
|
||||
<view>现金余额</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>¥{{ member_info.balance }}</view>
|
||||
<view>储值余额</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>{{ accountInfo.member_coupon_count }}</view>
|
||||
<view>优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="assets-box assets-order">
|
||||
<view class="assets-title">
|
||||
<text class="color-base-bg"></text>
|
||||
<text>订单资产</text>
|
||||
</view>
|
||||
<view class="assets-list">
|
||||
<view class="assets-li">
|
||||
<view>{{ accountInfo.order_pay_count }}</view>
|
||||
<view>待发货</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>{{ accountInfo.order_delivery_count }}</view>
|
||||
<view>待收货</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>{{ accountInfo.order_refund_count }}</view>
|
||||
<view>退款中</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="member_info.is_fenxiao == 1" class="assets-box assets-fenxiao">
|
||||
<view class="assets-title">
|
||||
<text class="color-base-bg"></text>
|
||||
<text>分销资产</text>
|
||||
</view>
|
||||
<view class="assets-list">
|
||||
<view class="assets-li">
|
||||
<view>¥{{ fenxiao_info.account }}</view>
|
||||
<view>可提现佣金</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>¥{{ fenxiao_info.account_withdraw_apply }}</view>
|
||||
<view>提现中佣金</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>{{ accountInfo.fenxiao_order_count }}</view>
|
||||
<view>待结算订单</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="assets-btn">
|
||||
<button type="primary" @click="prev">上一步</button>
|
||||
<button class="color-base-bg" @click="submit">确认申请</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import memberPublic from './public/js/member-public.js';
|
||||
|
||||
export default {
|
||||
mixins: [memberPublic],
|
||||
data() {
|
||||
return {
|
||||
accountInfo: {},
|
||||
member_info: {},
|
||||
fenxiao_info: {}
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
if (option.back) this.back = option.back;
|
||||
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getAccountInfo();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getAccountInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/accountInfo',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.accountInfo = res.data;
|
||||
this.member_info = res.data.member_info;
|
||||
if (res.data.member_info.is_fenxiao == 1) {
|
||||
this.fenxiao_info = res.data.fenxiao_info;
|
||||
}
|
||||
} else if (res.code == -1) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
prev() {
|
||||
this.$util.redirectTo('/pages_tool/member/cancellation');
|
||||
},
|
||||
submit() {
|
||||
this.submitCancelApply();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.assets-wrap {
|
||||
.assets-block {
|
||||
padding: 0 24rpx;
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
|
||||
.assets-tips {
|
||||
width: 100%;
|
||||
height: 56rpx;
|
||||
background-color: rgba(250, 106, 0, 0.2);
|
||||
border-radius: 6rpx;
|
||||
line-height: 56rpx;
|
||||
padding-left: 20rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
text {
|
||||
color: #fa6a00;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.assets-box {
|
||||
width: 100%;
|
||||
margin-top: 30rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 6rpx;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.assets-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
text:nth-child(1) {
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
margin-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 28rpx;
|
||||
padding-top: 8rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.assets-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
padding: 0 26rpx 35rpx;
|
||||
margin-top: 53rpx;
|
||||
|
||||
.assets-li {
|
||||
text-align: center;
|
||||
|
||||
view:nth-child(1) {
|
||||
font-size: 36rpx;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
view:nth-child(2) {
|
||||
font-size: 28rpx;
|
||||
line-height: 28rpx;
|
||||
color: #666666;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.assets-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
|
||||
button {
|
||||
width: 300rpx;
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 0 15rpx;
|
||||
}
|
||||
|
||||
button[type='primary'] {
|
||||
background-color: unset !important;
|
||||
color: #333333;
|
||||
border: 2rpx solid #dddddd;
|
||||
}
|
||||
|
||||
button:nth-child(2) {
|
||||
color: var(--btn-text-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="assets-wrap">
|
||||
<view class="assets-block">
|
||||
<view class="assets-tips"><text>{{ $lang("member.assets.l5") }}</text></view>
|
||||
<view class="assets-box assets-account">
|
||||
<view class="assets-title">
|
||||
<text class="color-base-bg"></text>
|
||||
<text>{{ $lang("member.assets.l9") }}</text>
|
||||
</view>
|
||||
<view class="assets-list">
|
||||
<view class="assets-li">
|
||||
<view>{{ member_info.point }}</view>
|
||||
<view>{{ $lang("common.register-reward.l19.t0") }}</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>¥{{ member_info.balance_money }}</view>
|
||||
<view>{{ $lang("member.assets.l18") }}</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>¥{{ member_info.balance }}</view>
|
||||
<view>{{ $lang("member.assets.l22") }}</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>{{ accountInfo.member_coupon_count }}</view>
|
||||
<view>{{ $lang("diy.diy-coupon.l209.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="assets-box assets-order">
|
||||
<view class="assets-title">
|
||||
<text class="color-base-bg"></text>
|
||||
<text>{{ $lang("member.assets.l33") }}</text>
|
||||
</view>
|
||||
<view class="assets-list">
|
||||
<view class="assets-li">
|
||||
<view>{{ accountInfo.order_pay_count }}</view>
|
||||
<view>{{ $lang("order.list.l302") }}</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>{{ accountInfo.order_delivery_count }}</view>
|
||||
<view>{{ $lang("order.list.l307") }}</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>{{ accountInfo.order_refund_count }}</view>
|
||||
<view>{{ $lang("member.assets.l46") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="member_info.is_fenxiao == 1" class="assets-box assets-fenxiao">
|
||||
<view class="assets-title">
|
||||
<text class="color-base-bg"></text>
|
||||
<text>{{ $lang("member.assets.l54") }}</text>
|
||||
</view>
|
||||
<view class="assets-list">
|
||||
<view class="assets-li">
|
||||
<view>¥{{ fenxiao_info.account }}</view>
|
||||
<view>{{ $lang("member.assets.l59") }}</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>¥{{ fenxiao_info.account_withdraw_apply }}</view>
|
||||
<view>{{ $lang("member.assets.l63") }}</view>
|
||||
</view>
|
||||
<view class="assets-li">
|
||||
<view>{{ accountInfo.fenxiao_order_count }}</view>
|
||||
<view>{{ $lang("member.assets.l67") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="assets-btn">
|
||||
<button type="primary" @click="prev">{{ $lang("member.assets.l73") }}</button>
|
||||
<button class="color-base-bg" @click="submit">{{ $lang("member.assets.l74") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import memberPublic from './public/js/member-public.js';
|
||||
|
||||
export default {
|
||||
mixins: [memberPublic],
|
||||
data() {
|
||||
return {
|
||||
accountInfo: {},
|
||||
member_info: {},
|
||||
fenxiao_info: {}
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
if (option.back) this.back = option.back;
|
||||
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getAccountInfo();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getAccountInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/accountInfo',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.accountInfo = res.data;
|
||||
this.member_info = res.data.member_info;
|
||||
if (res.data.member_info.is_fenxiao == 1) {
|
||||
this.fenxiao_info = res.data.fenxiao_info;
|
||||
}
|
||||
} else if (res.code == -1) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
prev() {
|
||||
this.$util.redirectTo('/pages_tool/member/cancellation');
|
||||
},
|
||||
submit() {
|
||||
this.submitCancelApply();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.assets-wrap {
|
||||
.assets-block {
|
||||
padding: 0 24rpx;
|
||||
padding-top: 30rpx;
|
||||
}
|
||||
|
||||
.assets-tips {
|
||||
width: 100%;
|
||||
height: 56rpx;
|
||||
background-color: rgba(250, 106, 0, 0.2);
|
||||
border-radius: 6rpx;
|
||||
line-height: 56rpx;
|
||||
padding-left: 20rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
text {
|
||||
color: #fa6a00;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.assets-box {
|
||||
width: 100%;
|
||||
margin-top: 30rpx;
|
||||
background-color: #ffffff;
|
||||
border-radius: 6rpx;
|
||||
padding: 20rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.assets-title {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
text:nth-child(1) {
|
||||
width: 6rpx;
|
||||
height: 28rpx;
|
||||
border-radius: 2rpx;
|
||||
}
|
||||
|
||||
text:nth-child(2) {
|
||||
margin-left: 20rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 28rpx;
|
||||
padding-top: 8rpx;
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
|
||||
.assets-list {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
flex-wrap: wrap;
|
||||
padding: 0 26rpx 35rpx;
|
||||
margin-top: 53rpx;
|
||||
|
||||
.assets-li {
|
||||
text-align: center;
|
||||
|
||||
view:nth-child(1) {
|
||||
font-size: 36rpx;
|
||||
line-height: 36rpx;
|
||||
}
|
||||
|
||||
view:nth-child(2) {
|
||||
font-size: 28rpx;
|
||||
line-height: 28rpx;
|
||||
color: #666666;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.assets-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
|
||||
button {
|
||||
width: 300rpx;
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 0 15rpx;
|
||||
}
|
||||
|
||||
button[type='primary'] {
|
||||
background-color: unset !important;
|
||||
color: #333333;
|
||||
border: 2rpx solid #dddddd;
|
||||
}
|
||||
|
||||
button:nth-child(2) {
|
||||
color: var(--btn-text-color);
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,189 +1,189 @@
|
||||
<template>
|
||||
<view class="balance" :style="themeColor">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="custom-navbar" :style="{
|
||||
'padding-top': menuButtonBounding.top + 'px',
|
||||
'height': menuButtonBounding.height + 'px'
|
||||
}">
|
||||
<view class="navbar-wrap">
|
||||
<text class="iconfont icon-back_light back" @click="$util.redirectTo($util.MEMBER_PAGE_URL)"></text>
|
||||
<view class="navbar-title">
|
||||
账户余额
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="head-wrap" :style="{ background: 'url(' + $util.img('public/uniapp/balance/balance-bg.png') + ')',backgroundSize:'100% 100%' }">
|
||||
<!-- <view class="head-wrap" :style="{ background: 'url(' + $util.img('public/uniapp/balance/balance-bg.png') + ') no-repeat right bottom/ auto 380rpx, linear-gradient(314deg, #FE7849 0%, #FF1959 100%)' }"> -->
|
||||
<view class="title">账户余额(元)</view>
|
||||
<view class="balance price-font">{{ (parseFloat(balanceInfo.balance) + parseFloat(balanceInfo.balance_money)).toFixed(2) }}</view>
|
||||
<!-- <view class="flex-box">
|
||||
<view class="flex-item">
|
||||
<view class="num price-font">{{ balanceInfo.balance_money|moneyFormat }}</view>
|
||||
<view class="font-size-tag">现金余额(元)</view>
|
||||
</view>
|
||||
<view class="flex-item">
|
||||
<view class="num price-font">{{ balanceInfo.balance|moneyFormat }}</view>
|
||||
<view class="font-size-tag">储值余额(元)</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="btns">
|
||||
<view class="cash btn" @click="toWithdrawal">提现</view>
|
||||
<view class="recharge btn" @click="toList">充值</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="menu-wrap">
|
||||
<view class="menu-item" @click="toApply" style="border-bottom: 0.5px solid #f2f2f2;">
|
||||
<view class="icon">
|
||||
<text class="iconfont icon-yuemingxi"></text>
|
||||
</view>
|
||||
<text class="title">提现记录</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<view class="menu-item" @click="toBalanceDetail" style="border-bottom: 0.5px solid #f2f2f2;">
|
||||
<view class="icon">
|
||||
<text class="iconfont icon-yuemingxi"></text>
|
||||
</view>
|
||||
<text class="title">余额明细</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<!-- <view class="menu-item" @click="toOrderList">
|
||||
<view class="icon">
|
||||
<text class="iconfont icon-chongzhijilu"></text>
|
||||
</view>
|
||||
<text class="title">充值记录</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- <view class="action">
|
||||
<view @click="toList" class="recharge-withdraw" v-if="addonIsExist.memberrecharge && memberrechargeConfig && memberrechargeConfig.is_use">
|
||||
{{ $lang('recharge') }}
|
||||
</view>
|
||||
<view class="withdraw" v-if="addonIsExist.memberwithdraw && withdrawConfig && withdrawConfig.is_use" @click="toWithdrawal">
|
||||
{{ $lang('withdrawal') }}
|
||||
</view>
|
||||
</view> -->
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
balanceInfo: {
|
||||
balance: 0,
|
||||
balance_money: 0
|
||||
},
|
||||
withdrawConfig: null,
|
||||
memberrechargeConfig: null,
|
||||
menuButtonBounding: {} // 小程序胶囊属性
|
||||
};
|
||||
},
|
||||
async onShow() {
|
||||
this.getWithdrawConfig();
|
||||
this.getMemberrechargeConfig();
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/balance');
|
||||
});
|
||||
} else {
|
||||
this.getUserInfo();
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef MP
|
||||
this.menuButtonBounding = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
toWithdrawal() {
|
||||
this.$util.redirectTo('/pages_tool/member/apply_withdrawal');
|
||||
},
|
||||
toOrderList() {
|
||||
this.$util.redirectTo('/pages_tool/recharge/order_list');
|
||||
},
|
||||
toBalanceDetail() {
|
||||
this.$util.redirectTo('/pages_tool/member/balance_detail');
|
||||
},
|
||||
toApply(){
|
||||
this.$util.redirectTo('/pages_tool/member/withdrawal');
|
||||
},
|
||||
toList() {
|
||||
this.$util.redirectTo('/pages_tool/recharge/list');
|
||||
},
|
||||
//获取余额信息
|
||||
getUserInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/info',
|
||||
data: {
|
||||
account_type: 'balance,balance_money'
|
||||
},
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.balanceInfo = res.data;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取余额提现配置
|
||||
*/
|
||||
getWithdrawConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/config',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.withdrawConfig = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取充值提现配置
|
||||
*/
|
||||
getMemberrechargeConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecharge/api/memberrecharge/config',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.memberrechargeConfig = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||
return true;
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getUserInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/balance.scss';
|
||||
</style>
|
||||
<template>
|
||||
<view class="balance" :style="themeColor">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="custom-navbar" :style="{
|
||||
'padding-top': menuButtonBounding.top + 'px',
|
||||
'height': menuButtonBounding.height + 'px'
|
||||
}">
|
||||
<view class="navbar-wrap">
|
||||
<text class="iconfont icon-back_light back" @click="$util.redirectTo($util.MEMBER_PAGE_URL)"></text>
|
||||
<view class="navbar-title">
|
||||
账户余额
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="head-wrap" :style="{ background: 'url(' + $util.img('public/uniapp/balance/balance-bg.png') + ')',backgroundSize:'100% 100%' }">
|
||||
<!-- <view class="head-wrap" :style="{ background: 'url(' + $util.img('public/uniapp/balance/balance-bg.png') + ') no-repeat right bottom/ auto 380rpx, linear-gradient(314deg, #FE7849 0%, #FF1959 100%)' }"> -->
|
||||
<view class="title">{{ $lang("member.balance.l19") }}</view>
|
||||
<view class="balance price-font">{{ (parseFloat(balanceInfo.balance) + parseFloat(balanceInfo.balance_money)).toFixed(2) }}</view>
|
||||
<!-- <view class="flex-box">
|
||||
<view class="flex-item">
|
||||
<view class="num price-font">{{ balanceInfo.balance_money|moneyFormat }}</view>
|
||||
<view class="font-size-tag">{{ $lang("member.balance.l24") }}</view>
|
||||
</view>
|
||||
<view class="flex-item">
|
||||
<view class="num price-font">{{ balanceInfo.balance|moneyFormat }}</view>
|
||||
<view class="font-size-tag">{{ $lang("member.balance.l28") }}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="btns">
|
||||
<view class="cash btn" @click="toWithdrawal">{{ $lang("fenxiao.withdraw_apply.l59") }}</view>
|
||||
<view class="recharge btn" @click="toList">{{ $lang("member.balance.l33") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="menu-wrap">
|
||||
<view class="menu-item" @click="toApply" style="border-bottom: 0.5px solid #f2f2f2;">
|
||||
<view class="icon">
|
||||
<text class="iconfont icon-yuemingxi"></text>
|
||||
</view>
|
||||
<text class="title">{{ $lang("fenxiao.withdraw_apply.l64") }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<view class="menu-item" @click="toBalanceDetail" style="border-bottom: 0.5px solid #f2f2f2;">
|
||||
<view class="icon">
|
||||
<text class="iconfont icon-yuemingxi"></text>
|
||||
</view>
|
||||
<text class="title">{{ $lang("member.balance.l49") }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<!-- <view class="menu-item" @click="toOrderList">
|
||||
<view class="icon">
|
||||
<text class="iconfont icon-chongzhijilu"></text>
|
||||
</view>
|
||||
<text class="title">{{ $lang("member.balance.l56") }}</text>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<!-- <view class="action">
|
||||
<view @click="toList" class="recharge-withdraw" v-if="addonIsExist.memberrecharge && memberrechargeConfig && memberrechargeConfig.is_use">
|
||||
{{ $lang('recharge') }}
|
||||
</view>
|
||||
<view class="withdraw" v-if="addonIsExist.memberwithdraw && withdrawConfig && withdrawConfig.is_use" @click="toWithdrawal">
|
||||
{{ $lang('fenxiao.list.withdrawal') }}
|
||||
</view>
|
||||
</view> -->
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
balanceInfo: {
|
||||
balance: 0,
|
||||
balance_money: 0
|
||||
},
|
||||
withdrawConfig: null,
|
||||
memberrechargeConfig: null,
|
||||
menuButtonBounding: {} // 小程序胶囊属性
|
||||
};
|
||||
},
|
||||
async onShow() {
|
||||
this.getWithdrawConfig();
|
||||
this.getMemberrechargeConfig();
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/balance');
|
||||
});
|
||||
} else {
|
||||
this.getUserInfo();
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef MP
|
||||
this.menuButtonBounding = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
toWithdrawal() {
|
||||
this.$util.redirectTo('/pages_tool/member/apply_withdrawal');
|
||||
},
|
||||
toOrderList() {
|
||||
this.$util.redirectTo('/pages_tool/recharge/order_list');
|
||||
},
|
||||
toBalanceDetail() {
|
||||
this.$util.redirectTo('/pages_tool/member/balance_detail');
|
||||
},
|
||||
toApply(){
|
||||
this.$util.redirectTo('/pages_tool/member/withdrawal');
|
||||
},
|
||||
toList() {
|
||||
this.$util.redirectTo('/pages_tool/recharge/list');
|
||||
},
|
||||
//获取余额信息
|
||||
getUserInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/info',
|
||||
data: {
|
||||
account_type: 'balance,balance_money'
|
||||
},
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.balanceInfo = res.data;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取余额提现配置
|
||||
*/
|
||||
getWithdrawConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/config',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.withdrawConfig = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取充值提现配置
|
||||
*/
|
||||
getMemberrechargeConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecharge/api/memberrecharge/config',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.memberrechargeConfig = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||
return true;
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getUserInfo();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/balance.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,362 +1,362 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<!-- <scroll-view id="tab-bar" class="order-nav" :scroll-x="true" :show-scrollbar="false" :scroll-into-view="scrollInto">
|
||||
<view v-for="(statusItem, statusIndex) in statusList" :key="statusIndex" class="uni-tab-item" :id="statusItem.id" :data-current="statusIndex" @click="ontabtap">
|
||||
<text class="uni-tab-item-title" :class="statusIndex == orderStatus ? 'uni-tab-item-title-active' : ''">{{ statusItem.name }}</text>
|
||||
</view>
|
||||
</scroll-view> -->
|
||||
<!-- <view class="tab color-bg">
|
||||
<view class="tab-left">
|
||||
<picker mode="date" :value="searchType.date" @change="bindDateChange" fields="month">
|
||||
<view class="uni-input">
|
||||
{{ date }}
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="tab-right">
|
||||
<picker @change="bindPickerChange" :value="balanceIndex" :range="balanceType" class="picker" range-key="label">
|
||||
<text class="desc uni-input">{{ balanceType[balanceIndex].label }}</text>
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</picker>
|
||||
</view>
|
||||
</view> -->
|
||||
<mescroll-uni @getData="getData" ref="mescroll">
|
||||
<block slot="list">
|
||||
<!-- 明细列表 -->
|
||||
<block v-if="dataList.length > 0">
|
||||
<view class="detailed-wrap">
|
||||
<view class="balances" v-for="(item, index) in dataList" :key="index">
|
||||
<image :src="$util.img('public/uniapp/balance/recharge.png')" class="balances-img"
|
||||
v-if="item.account_data > 0" show-menu-by-longpress></image>
|
||||
<image v-else :src="$util.img('public/uniapp/balance/shopping.png')" mode="widthFix" show-menu-by-longpress>
|
||||
</image>
|
||||
<view class="balances-info" @click="toFromDetail(item)">
|
||||
<text class="title">{{ item.remark }}</text>
|
||||
<!-- <text>{{ item.remark }}</text> -->
|
||||
<text>{{ $util.timeStampTurnTime(item.create_time) }}</text>
|
||||
</view>
|
||||
<view class="balances-num">
|
||||
<text :class="item.account_data > 0 ? 'color-base-text' : ''">{{ item.account_data > 0 ?
|
||||
'+' + item.account_data : item.account_data }}元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else><ns-empty :isIndex="false" text="暂无余额明细"></ns-empty></block>
|
||||
<!-- 无明细列表 -->
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
const currentDate = this.getDate({
|
||||
format: true
|
||||
});
|
||||
return {
|
||||
dataList: [],
|
||||
statusList: [{
|
||||
name: '全部',
|
||||
id: '0'
|
||||
}, {
|
||||
name: '收入',
|
||||
id: '1'
|
||||
}, {
|
||||
name: '支出',
|
||||
id: '2'
|
||||
}],
|
||||
scrollInto: '',
|
||||
orderStatus: '0',
|
||||
date: currentDate,
|
||||
searchType: {
|
||||
from_type: 0,
|
||||
date: ''
|
||||
},
|
||||
balanceType: [{
|
||||
label: '全部',
|
||||
value: '0'
|
||||
}], //积分类型
|
||||
balanceIndex: 0,
|
||||
related_id: 0
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.group_id) this.related_id = option.group_id ? option.group_id : 0;
|
||||
if (option.from_type) this.searchType.from_type = option.from_type;
|
||||
if (option.related_id) this.related_id = option.related_id ? option.related_id : 0;
|
||||
if (option.status) this.orderStatus = option.status;
|
||||
this.getbalanceType();
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/balance');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
bindDateChange: function (e) {
|
||||
var temp = e.target.value;
|
||||
var tempArr = temp.split('-');
|
||||
this.date = tempArr[0] + '年' + tempArr[1] + '月';
|
||||
this.searchType.date = e.target.value;
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
getDate(type) {
|
||||
const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth() + 1;
|
||||
let day = date.getDate();
|
||||
|
||||
if (type === 'start') {
|
||||
year = year - 60;
|
||||
} else if (type === 'end') {
|
||||
year = year + 2;
|
||||
}
|
||||
month = month > 9 ? month : '0' + month;
|
||||
day = day > 9 ? day : '0' + day;
|
||||
return `${year}年${month}月`;
|
||||
},
|
||||
bindPickerChange(e) {
|
||||
this.balanceIndex = e.detail.value;
|
||||
this.searchType.from_type = this.balanceType[this.balanceIndex].value;
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
//获取分类类型
|
||||
getbalanceType() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/fromType',
|
||||
success: res => {
|
||||
let balanceType = Object.assign(res.balance, res.balance_money),
|
||||
typeArr = [{
|
||||
label: '全部',
|
||||
value: '0'
|
||||
}];
|
||||
for (var index in balanceType) {
|
||||
typeArr.push({
|
||||
label: balanceType[index].type_name,
|
||||
value: index
|
||||
})
|
||||
}
|
||||
this.balanceType = typeArr;
|
||||
}
|
||||
});
|
||||
},
|
||||
ontabtap(e) {
|
||||
let index = e.currentTarget.dataset.current;
|
||||
this.orderStatus = this.statusList[index].id;
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num,
|
||||
account_type: 'balance,balance_money',
|
||||
from_type: this.searchType.from_type,
|
||||
date: this.searchType.date,
|
||||
related_id: this.related_id
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) {
|
||||
this.dataList = []; //如果是第一页需手动制空列表
|
||||
this.related_id = 0;
|
||||
}
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
toFromDetail(item) {
|
||||
if (item.from_type == 'order' && !isNaN(parseInt(item.type_tag))) {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
} else if (item.from_type == 'refund' && parseInt(item.type_tag) != 0) {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.detailed-wrap {
|
||||
padding-top: 20rpx;
|
||||
|
||||
margin: 24rpx;
|
||||
}
|
||||
|
||||
.tab {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 80rpx;
|
||||
background-color: $color-bg;
|
||||
|
||||
view {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
|
||||
text {
|
||||
margin-left: 10rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-left {
|
||||
display: flex;
|
||||
padding-left: 46rpx;
|
||||
}
|
||||
|
||||
.tab-right {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-right: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.order-nav {
|
||||
width: 100vw;
|
||||
height: 70rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
/* #ifndef APP-PLUS */
|
||||
white-space: nowrap;
|
||||
/* #endif */
|
||||
background: #fff;
|
||||
border-bottom-left-radius: 24rpx;
|
||||
border-bottom-right-radius: 24rpx;
|
||||
padding-bottom: 30rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
z-index: 998;
|
||||
|
||||
.uni-tab-item {
|
||||
width: 33.33%;
|
||||
text-align: center;
|
||||
/* #ifndef APP-PLUS */
|
||||
display: inline-block;
|
||||
/* #endif */
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.uni-tab-item-title {
|
||||
color: #555;
|
||||
font-size: $font-size-base;
|
||||
display: block;
|
||||
height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
border-bottom: 4rpx solid #fff;
|
||||
padding: 0 10rpx;
|
||||
flex-wrap: nowrap;
|
||||
/* #ifndef APP-PLUS */
|
||||
white-space: nowrap;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.uni-tab-item-title-active {
|
||||
display: block;
|
||||
height: 64rpx;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.balances {
|
||||
padding: $margin-both 24rpx;
|
||||
// margin: 0 $margin-both;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
background: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 24rpx;
|
||||
|
||||
image {
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
border-radius: 50%;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
|
||||
.balances-info {
|
||||
flex: 1;
|
||||
margin-left: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
line-height: 1;
|
||||
|
||||
&:last-child {}
|
||||
|
||||
&:nth-child(2) {
|
||||
margin-top: $margin-updown;
|
||||
font-size: $font-size-activity-tag;
|
||||
color: $color-tip;
|
||||
}
|
||||
|
||||
&:nth-child(3) {
|
||||
font-size: $font-size-activity-tag;
|
||||
margin-top: $margin-updown;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.balances-num {
|
||||
text {
|
||||
line-height: 1;
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: 500;
|
||||
color: #09c15f;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<!-- <scroll-view id="tab-bar" class="order-nav" :scroll-x="true" :show-scrollbar="false" :scroll-into-view="scrollInto">
|
||||
<view v-for="(statusItem, statusIndex) in statusList" :key="statusIndex" class="uni-tab-item" :id="statusItem.id" :data-current="statusIndex" @click="ontabtap">
|
||||
<text class="uni-tab-item-title" :class="statusIndex == orderStatus ? 'uni-tab-item-title-active' : ''">{{ statusItem.name }}</text>
|
||||
</view>
|
||||
</scroll-view> -->
|
||||
<!-- <view class="tab color-bg">
|
||||
<view class="tab-left">
|
||||
<picker mode="date" :value="searchType.date" @change="bindDateChange" fields="month">
|
||||
<view class="uni-input">
|
||||
{{ date }}
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="tab-right">
|
||||
<picker @change="bindPickerChange" :value="balanceIndex" :range="balanceType" class="picker" range-key="label">
|
||||
<text class="desc uni-input">{{ balanceType[balanceIndex].label }}</text>
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</picker>
|
||||
</view>
|
||||
</view> -->
|
||||
<mescroll-uni @getData="getData" ref="mescroll">
|
||||
<block slot="list">
|
||||
<!-- 明细列表 -->
|
||||
<block v-if="dataList.length > 0">
|
||||
<view class="detailed-wrap">
|
||||
<view class="balances" v-for="(item, index) in dataList" :key="index">
|
||||
<image :src="$util.img('public/uniapp/balance/recharge.png')" class="balances-img"
|
||||
v-if="item.account_data > 0" show-menu-by-longpress></image>
|
||||
<image v-else :src="$util.img('public/uniapp/balance/shopping.png')" mode="widthFix" show-menu-by-longpress>
|
||||
</image>
|
||||
<view class="balances-info" @click="toFromDetail(item)">
|
||||
<text class="title">{{ item.remark }}</text>
|
||||
<!-- <text>{{ item.remark }}</text> -->
|
||||
<text>{{ $util.timeStampTurnTime(item.create_time) }}</text>
|
||||
</view>
|
||||
<view class="balances-num">
|
||||
<text :class="item.account_data > 0 ? 'color-base-text' : ''">{{ item.account_data > 0 ?
|
||||
'+' + item.account_data : item.account_data }}元</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else><ns-empty :isIndex="false" text=$lang("member.balance_detail.l46")></ns-empty></block>
|
||||
<!-- 无明细列表 -->
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
const currentDate = this.getDate({
|
||||
format: true
|
||||
});
|
||||
return {
|
||||
dataList: [],
|
||||
statusList: [{
|
||||
name: $lang('diy.diy-category-item.l47.t0'),
|
||||
id: '0'
|
||||
}, {
|
||||
name: $lang('member.balance_detail.l68'),
|
||||
id: '1'
|
||||
}, {
|
||||
name: $lang('member.balance_detail.l71'),
|
||||
id: '2'
|
||||
}],
|
||||
scrollInto: '',
|
||||
orderStatus: '0',
|
||||
date: currentDate,
|
||||
searchType: {
|
||||
from_type: 0,
|
||||
date: ''
|
||||
},
|
||||
balanceType: [{
|
||||
label: $lang('diy.diy-category-item.l47.t0'),
|
||||
value: '0'
|
||||
}], //积分类型
|
||||
balanceIndex: 0,
|
||||
related_id: 0
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.group_id) this.related_id = option.group_id ? option.group_id : 0;
|
||||
if (option.from_type) this.searchType.from_type = option.from_type;
|
||||
if (option.related_id) this.related_id = option.related_id ? option.related_id : 0;
|
||||
if (option.status) this.orderStatus = option.status;
|
||||
this.getbalanceType();
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/balance');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
bindDateChange: function (e) {
|
||||
var temp = e.target.value;
|
||||
var tempArr = temp.split('-');
|
||||
this.date = tempArr[0] + $lang('order._components.common-payment.payment.l159.t0') + tempArr[1] + $lang('common.ns-select-time.l96.t0');
|
||||
this.searchType.date = e.target.value;
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
getDate(type) {
|
||||
const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth() + 1;
|
||||
let day = date.getDate();
|
||||
|
||||
if (type === 'start') {
|
||||
year = year - 60;
|
||||
} else if (type === 'end') {
|
||||
year = year + 2;
|
||||
}
|
||||
month = month > 9 ? month : '0' + month;
|
||||
day = day > 9 ? day : '0' + day;
|
||||
return $lang(`member.balance_detail.l124.t0`);
|
||||
},
|
||||
bindPickerChange(e) {
|
||||
this.balanceIndex = e.detail.value;
|
||||
this.searchType.from_type = this.balanceType[this.balanceIndex].value;
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
//获取分类类型
|
||||
getbalanceType() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/fromType',
|
||||
success: res => {
|
||||
let balanceType = Object.assign(res.balance, res.balance_money),
|
||||
typeArr = [{
|
||||
label: $lang('diy.diy-category-item.l47.t0'),
|
||||
value: '0'
|
||||
}];
|
||||
for (var index in balanceType) {
|
||||
typeArr.push({
|
||||
label: balanceType[index].type_name,
|
||||
value: index
|
||||
})
|
||||
}
|
||||
this.balanceType = typeArr;
|
||||
}
|
||||
});
|
||||
},
|
||||
ontabtap(e) {
|
||||
let index = e.currentTarget.dataset.current;
|
||||
this.orderStatus = this.statusList[index].id;
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num,
|
||||
account_type: 'balance,balance_money',
|
||||
from_type: this.searchType.from_type,
|
||||
date: this.searchType.date,
|
||||
related_id: this.related_id
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) {
|
||||
this.dataList = []; //如果是第一页需手动制空列表
|
||||
this.related_id = 0;
|
||||
}
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
toFromDetail(item) {
|
||||
if (item.from_type == 'order' && !isNaN(parseInt(item.type_tag))) {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
} else if (item.from_type == 'refund' && parseInt(item.type_tag) != 0) {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.detailed-wrap {
|
||||
padding-top: 20rpx;
|
||||
|
||||
margin: 24rpx;
|
||||
}
|
||||
|
||||
.tab {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 80rpx;
|
||||
background-color: $color-bg;
|
||||
|
||||
view {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
|
||||
text {
|
||||
margin-left: 10rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
|
||||
.tab-left {
|
||||
display: flex;
|
||||
padding-left: 46rpx;
|
||||
}
|
||||
|
||||
.tab-right {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-right: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.order-nav {
|
||||
width: 100vw;
|
||||
height: 70rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
/* #ifndef APP-PLUS */
|
||||
white-space: nowrap;
|
||||
/* #endif */
|
||||
background: #fff;
|
||||
border-bottom-left-radius: 24rpx;
|
||||
border-bottom-right-radius: 24rpx;
|
||||
padding-bottom: 30rpx;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
z-index: 998;
|
||||
|
||||
.uni-tab-item {
|
||||
width: 33.33%;
|
||||
text-align: center;
|
||||
/* #ifndef APP-PLUS */
|
||||
display: inline-block;
|
||||
/* #endif */
|
||||
flex-wrap: nowrap;
|
||||
}
|
||||
|
||||
.uni-tab-item-title {
|
||||
color: #555;
|
||||
font-size: $font-size-base;
|
||||
display: block;
|
||||
height: 64rpx;
|
||||
line-height: 64rpx;
|
||||
border-bottom: 4rpx solid #fff;
|
||||
padding: 0 10rpx;
|
||||
flex-wrap: nowrap;
|
||||
/* #ifndef APP-PLUS */
|
||||
white-space: nowrap;
|
||||
/* #endif */
|
||||
}
|
||||
|
||||
.uni-tab-item-title-active {
|
||||
display: block;
|
||||
height: 64rpx;
|
||||
padding: 0 10rpx;
|
||||
}
|
||||
|
||||
::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
}
|
||||
}
|
||||
|
||||
.balances {
|
||||
padding: $margin-both 24rpx;
|
||||
// margin: 0 $margin-both;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
align-items: flex-start;
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
background: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
border-radius: 24rpx;
|
||||
|
||||
image {
|
||||
width: 54rpx;
|
||||
height: 54rpx;
|
||||
border-radius: 50%;
|
||||
padding-top: 10rpx;
|
||||
}
|
||||
|
||||
.balances-info {
|
||||
flex: 1;
|
||||
margin-left: 16rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
line-height: 1;
|
||||
|
||||
&:last-child {}
|
||||
|
||||
&:nth-child(2) {
|
||||
margin-top: $margin-updown;
|
||||
font-size: $font-size-activity-tag;
|
||||
color: $color-tip;
|
||||
}
|
||||
|
||||
&:nth-child(3) {
|
||||
font-size: $font-size-activity-tag;
|
||||
margin-top: $margin-updown;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.balances-num {
|
||||
text {
|
||||
line-height: 1;
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: 500;
|
||||
color: #09c15f;
|
||||
font-weight: 700;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
}
|
||||
</style>
|
||||
@@ -1,133 +1,133 @@
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="agreement-box">
|
||||
<view class="agreement-intro">
|
||||
<view class="align-center agreement-title">{{ agreement.title }}</view>
|
||||
<rich-text class="agreement-content" :nodes="agreement.content"></rich-text>
|
||||
</view>
|
||||
|
||||
<view class="agreement-btn">
|
||||
<view class="align-center agreement-btn-select">
|
||||
<text v-if="isSelect" class="iconfont icon-dui color-base-text" @click="changeSelect"></text>
|
||||
<text v-else class="iconfont icon-yuan_checkbox" @click="changeSelect"></text>
|
||||
<text class="agreement-text" @click="changeSelect">勾选即表示您已阅读并同意本协议</text>
|
||||
</view>
|
||||
<button class="btn color-base-bg" @click="next">下一步</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import htmlParser from '@/common/js/html-parser';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
agreement: {},
|
||||
isSelect: false
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getCancelAgreement();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCancelAgreement() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/agreement',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.agreement = res.data;
|
||||
if (this.agreement.content) this.agreement.content = htmlParser(this.agreement.content);
|
||||
} else if (res.code == -1) {
|
||||
this.$store.commit('setToken', '');
|
||||
this.$store.commit('setMemberInfo', '');
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
changeSelect() {
|
||||
this.isSelect = this.isSelect == true ? false : true;
|
||||
},
|
||||
next() {
|
||||
if (this.isSelect) {
|
||||
this.$util.redirectTo('/pages_tool/member/assets');
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '请先勾选同意协议'
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.agreement-box {
|
||||
.align-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.agreement-intro {
|
||||
height: calc(100vh - 210rpx);
|
||||
padding-top: 40rpx;
|
||||
padding-left: 40rpx;
|
||||
padding-right: 40rpx;
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
|
||||
.agreement-title {
|
||||
font-size: 32rpx;
|
||||
line-height: 60rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.agreement-content {
|
||||
font-size: 24rpx;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.agreement-btn {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 210rpx;
|
||||
bottom: 0;
|
||||
padding-top: 16rpx;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
|
||||
.agreement-btn-select {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.agreement-btn-select .iconfont {
|
||||
color: #838383;
|
||||
}
|
||||
|
||||
.agreement-text {
|
||||
font-size: 28rpx;
|
||||
color: #838383;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
button {
|
||||
display: inline-block;
|
||||
margin-top: 20rpx;
|
||||
color: var(--btn-text-color);
|
||||
font-size: 28rpx;
|
||||
width: 300rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="agreement-box">
|
||||
<view class="agreement-intro">
|
||||
<view class="align-center agreement-title">{{ agreement.title }}</view>
|
||||
<rich-text class="agreement-content" :nodes="agreement.content"></rich-text>
|
||||
</view>
|
||||
|
||||
<view class="agreement-btn">
|
||||
<view class="align-center agreement-btn-select">
|
||||
<text v-if="isSelect" class="iconfont icon-dui color-base-text" @click="changeSelect"></text>
|
||||
<text v-else class="iconfont icon-yuan_checkbox" @click="changeSelect"></text>
|
||||
<text class="agreement-text" @click="changeSelect">{{ $lang("member.cancellation.l13") }}</text>
|
||||
</view>
|
||||
<button class="btn color-base-bg" @click="next">{{ $lang("member.cancellation.l15") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import htmlParser from '@/common/js/html-parser';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
agreement: {},
|
||||
isSelect: false
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getCancelAgreement();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getCancelAgreement() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/agreement',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.agreement = res.data;
|
||||
if (this.agreement.content) this.agreement.content = htmlParser(this.agreement.content);
|
||||
} else if (res.code == -1) {
|
||||
this.$store.commit('setToken', '');
|
||||
this.$store.commit('setMemberInfo', '');
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
changeSelect() {
|
||||
this.isSelect = this.isSelect == true ? false : true;
|
||||
},
|
||||
next() {
|
||||
if (this.isSelect) {
|
||||
this.$util.redirectTo('/pages_tool/member/assets');
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.cancellation.l63')
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.agreement-box {
|
||||
.align-center {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.agreement-intro {
|
||||
height: calc(100vh - 210rpx);
|
||||
padding-top: 40rpx;
|
||||
padding-left: 40rpx;
|
||||
padding-right: 40rpx;
|
||||
box-sizing: border-box;
|
||||
overflow-y: auto;
|
||||
|
||||
.agreement-title {
|
||||
font-size: 32rpx;
|
||||
line-height: 60rpx;
|
||||
margin-bottom: 10rpx;
|
||||
}
|
||||
|
||||
.agreement-content {
|
||||
font-size: 24rpx;
|
||||
line-height: 44rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.agreement-btn {
|
||||
position: fixed;
|
||||
width: 100%;
|
||||
height: 210rpx;
|
||||
bottom: 0;
|
||||
padding-top: 16rpx;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
|
||||
.agreement-btn-select {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.agreement-btn-select .iconfont {
|
||||
color: #838383;
|
||||
}
|
||||
|
||||
.agreement-text {
|
||||
font-size: 28rpx;
|
||||
color: #838383;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
|
||||
button {
|
||||
display: inline-block;
|
||||
margin-top: 20rpx;
|
||||
color: var(--btn-text-color);
|
||||
font-size: 28rpx;
|
||||
width: 300rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,117 +1,117 @@
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="cancel-wrap">
|
||||
<view class="cancel-img"><image :src="$util.img('public/uniapp/member/refuse.png')" show-menu-by-longpress></image></view>
|
||||
<view class="cancel-title">您的申请已拒绝</view>
|
||||
<view class="cancel-reason">拒绝理由:{{ reason }}</view>
|
||||
<view class="cancel-btn">
|
||||
<button type="primary" @click="toIndex">返回</button>
|
||||
<button class="color-base-bg" @click="apply">重新申请</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
reason: ''
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
if (option.back) this.back = option.back;
|
||||
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getStatus();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getStatus() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/info',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.reason = res.data.reason;
|
||||
} else if (res.code == -1) {
|
||||
this.$store.commit('setToken', '');
|
||||
this.$store.commit('setMemberInfo', '');
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
toIndex() {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
},
|
||||
apply() {
|
||||
this.$util.redirectTo('/pages_tool/member/cancellation');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cancel-wrap {
|
||||
padding-top: 300rpx;
|
||||
text-align: center;
|
||||
|
||||
.cancel-img {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
display: inline-block;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.cancel-title {
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
line-height: 32rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.cancel-reason {
|
||||
color: #838383;
|
||||
font-size: 28rpx;
|
||||
line-height: 50rpx;
|
||||
margin-top: 20rpx;
|
||||
padding: 0 75rpx;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-top: 173rpx;
|
||||
|
||||
button {
|
||||
width: 300rpx;
|
||||
height: 84rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 84rpx;
|
||||
margin: 0 15rpx;
|
||||
border-radius: $border-radius;
|
||||
}
|
||||
|
||||
button[type='primary'] {
|
||||
background-color: unset !important;
|
||||
color: #333333;
|
||||
border: 2rpx solid #dddddd;
|
||||
}
|
||||
|
||||
button:nth-child(2) {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="cancel-wrap">
|
||||
<view class="cancel-img"><image :src="$util.img('public/uniapp/member/refuse.png')" show-menu-by-longpress></image></view>
|
||||
<view class="cancel-title">{{ $lang("member.cancelrefuse.l5") }}</view>
|
||||
<view class="cancel-reason">{ $lang("member.cancelrefuse.l6") } reason }}</view>
|
||||
<view class="cancel-btn">
|
||||
<button type="primary" @click="toIndex">{{ $lang("member.cancelrefuse.l8") }}</button>
|
||||
<button class="color-base-bg" @click="apply">{{ $lang("fenxiao.apply.l134") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
reason: ''
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
if (option.back) this.back = option.back;
|
||||
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getStatus();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getStatus() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/info',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.reason = res.data.reason;
|
||||
} else if (res.code == -1) {
|
||||
this.$store.commit('setToken', '');
|
||||
this.$store.commit('setMemberInfo', '');
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
toIndex() {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
},
|
||||
apply() {
|
||||
this.$util.redirectTo('/pages_tool/member/cancellation');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cancel-wrap {
|
||||
padding-top: 300rpx;
|
||||
text-align: center;
|
||||
|
||||
.cancel-img {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
display: inline-block;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.cancel-title {
|
||||
text-align: center;
|
||||
font-size: 32rpx;
|
||||
line-height: 32rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.cancel-reason {
|
||||
color: #838383;
|
||||
font-size: 28rpx;
|
||||
line-height: 50rpx;
|
||||
margin-top: 20rpx;
|
||||
padding: 0 75rpx;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
margin-top: 173rpx;
|
||||
|
||||
button {
|
||||
width: 300rpx;
|
||||
height: 84rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 84rpx;
|
||||
margin: 0 15rpx;
|
||||
border-radius: $border-radius;
|
||||
}
|
||||
|
||||
button[type='primary'] {
|
||||
background-color: unset !important;
|
||||
color: #333333;
|
||||
border: 2rpx solid #dddddd;
|
||||
}
|
||||
|
||||
button:nth-child(2) {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,189 +1,189 @@
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="cancelstatus-wrap">
|
||||
<view class="cancelstatus-block">
|
||||
<view class="cancelstatus-box">
|
||||
<view class="cancelstatus-box-sort color-base-bg">1</view>
|
||||
<view class="cancelstatus-box-con">
|
||||
<view class="cancelstatus-box-name">提交申请</view>
|
||||
<view class="cancelstatus-box-info">您已提交申请,请耐心等待~</view>
|
||||
</view>
|
||||
<view class="cancelstatus-box-line color-base-bg"></view>
|
||||
</view>
|
||||
<view class="cancelstatus-box">
|
||||
<view class="cancelstatus-box-sort color-base-bg">2</view>
|
||||
<view class="cancelstatus-box-con">
|
||||
<view class="cancelstatus-box-name">等待审核</view>
|
||||
<view class="cancelstatus-box-info">等待审核中,审核通过后您的账号将直接被删除</view>
|
||||
</view>
|
||||
<view class="cancelstatus-box-line color-base-bg" :class="{ 'opacity-4': state == 0 }"></view>
|
||||
</view>
|
||||
<view class="cancelstatus-box cancelstatus-box-last">
|
||||
<view class="cancelstatus-box-sort color-base-bg" :class="[ state == 1 ? 'opacity': 'opacity-4' ]">
|
||||
3
|
||||
</view>
|
||||
<view class="cancelstatus-box-con">
|
||||
<view class="cancelstatus-box-name">审核通过,注销完成</view>
|
||||
<view class="cancelstatus-box-info">您已成功注销账号,期待下一次与您相遇</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cancelstatus-btn" v-if="state == 0">
|
||||
<button type="primary" @click="back">返回</button>
|
||||
<button class="color-base-bg" @click="revoke">撤销申请</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import memberPublic from './public/js/member-public.js';
|
||||
|
||||
export default {
|
||||
mixins: [memberPublic],
|
||||
data() {
|
||||
return {
|
||||
state: 0
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getStatus();
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getStatus();
|
||||
},
|
||||
methods: {
|
||||
getStatus() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/info',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.state = res.data.status;
|
||||
if (this.state == -1) {
|
||||
this.$util.redirectTo('/pages_tool/member/cancelrefuse');
|
||||
}
|
||||
}
|
||||
|
||||
if (res.code == -1) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
back() {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
},
|
||||
revoke() {
|
||||
uni.showModal({
|
||||
title: '风险提示',
|
||||
content: '确定要撤销申请吗?',
|
||||
confirmColor: '#000000',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/cancelApply',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cancelstatus-wrap {
|
||||
.cancelstatus-block {
|
||||
padding: 50rpx;
|
||||
}
|
||||
|
||||
.cancelstatus-box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
height: 200rpx;
|
||||
|
||||
.cancelstatus-box-sort {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
text-align: center;
|
||||
line-height: 36rpx;
|
||||
border-radius: 50%;
|
||||
color: #ffffff;
|
||||
margin-right: 17rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.opacity {
|
||||
opacity: 1;
|
||||
|
||||
&-4 {
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
|
||||
.cancelstatus-box-name {
|
||||
font-size: 32rpx;
|
||||
line-height: 32rpx;
|
||||
margin-top: 3rpx;
|
||||
}
|
||||
|
||||
.cancelstatus-box-info {
|
||||
margin-top: 15rpx;
|
||||
color: #666666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.cancelstatus-box-line {
|
||||
position: absolute;
|
||||
width: 2rpx;
|
||||
height: 164rpx;
|
||||
top: 36rpx;
|
||||
left: 18rpx;
|
||||
}
|
||||
|
||||
&.cancelstatus-box-last {
|
||||
height: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cancelstatus-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
|
||||
button {
|
||||
width: 300rpx;
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 0 15rpx;
|
||||
border-radius: $border-radius;
|
||||
}
|
||||
|
||||
button[type='primary'] {
|
||||
background-color: unset !important;
|
||||
color: #333333;
|
||||
border: 2rpx solid #dddddd;
|
||||
}
|
||||
|
||||
button:nth-child(2) {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="cancelstatus-wrap">
|
||||
<view class="cancelstatus-block">
|
||||
<view class="cancelstatus-box">
|
||||
<view class="cancelstatus-box-sort color-base-bg">1</view>
|
||||
<view class="cancelstatus-box-con">
|
||||
<view class="cancelstatus-box-name">{{ $lang("member.cancelstatus.l8") }}</view>
|
||||
<view class="cancelstatus-box-info">{{ $lang("member.cancelstatus.l9") }}</view>
|
||||
</view>
|
||||
<view class="cancelstatus-box-line color-base-bg"></view>
|
||||
</view>
|
||||
<view class="cancelstatus-box">
|
||||
<view class="cancelstatus-box-sort color-base-bg">2</view>
|
||||
<view class="cancelstatus-box-con">
|
||||
<view class="cancelstatus-box-name">{{ $lang("member.cancelstatus.l16") }}</view>
|
||||
<view class="cancelstatus-box-info">{{ $lang("member.cancelstatus.l17") }}</view>
|
||||
</view>
|
||||
<view class="cancelstatus-box-line color-base-bg" :class="{ 'opacity-4': state == 0 }"></view>
|
||||
</view>
|
||||
<view class="cancelstatus-box cancelstatus-box-last">
|
||||
<view class="cancelstatus-box-sort color-base-bg" :class="[ state == 1 ? 'opacity': 'opacity-4' ]">
|
||||
3
|
||||
</view>
|
||||
<view class="cancelstatus-box-con">
|
||||
<view class="cancelstatus-box-name">{{ $lang("member.cancelstatus.l26") }}</view>
|
||||
<view class="cancelstatus-box-info">{{ $lang("member.cancelstatus.l27") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="cancelstatus-btn" v-if="state == 0">
|
||||
<button type="primary" @click="back">{{ $lang("member.cancelrefuse.l8") }}</button>
|
||||
<button class="color-base-bg" @click="revoke">{{ $lang("member.cancelstatus.l33") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import memberPublic from './public/js/member-public.js';
|
||||
|
||||
export default {
|
||||
mixins: [memberPublic],
|
||||
data() {
|
||||
return {
|
||||
state: 0
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getStatus();
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getStatus();
|
||||
},
|
||||
methods: {
|
||||
getStatus() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/info',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.state = res.data.status;
|
||||
if (this.state == -1) {
|
||||
this.$util.redirectTo('/pages_tool/member/cancelrefuse');
|
||||
}
|
||||
}
|
||||
|
||||
if (res.code == -1) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
back() {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
},
|
||||
revoke() {
|
||||
uni.showModal({
|
||||
title: $lang('member.cancelstatus.l84'),
|
||||
content: $lang('member.cancelstatus.l85'),
|
||||
confirmColor: '#000000',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/cancelApply',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cancelstatus-wrap {
|
||||
.cancelstatus-block {
|
||||
padding: 50rpx;
|
||||
}
|
||||
|
||||
.cancelstatus-box {
|
||||
position: relative;
|
||||
display: flex;
|
||||
height: 200rpx;
|
||||
|
||||
.cancelstatus-box-sort {
|
||||
width: 36rpx;
|
||||
height: 36rpx;
|
||||
text-align: center;
|
||||
line-height: 36rpx;
|
||||
border-radius: 50%;
|
||||
color: #ffffff;
|
||||
margin-right: 17rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.opacity {
|
||||
opacity: 1;
|
||||
|
||||
&-4 {
|
||||
opacity: 0.4;
|
||||
}
|
||||
}
|
||||
|
||||
.cancelstatus-box-name {
|
||||
font-size: 32rpx;
|
||||
line-height: 32rpx;
|
||||
margin-top: 3rpx;
|
||||
}
|
||||
|
||||
.cancelstatus-box-info {
|
||||
margin-top: 15rpx;
|
||||
color: #666666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
|
||||
.cancelstatus-box-line {
|
||||
position: absolute;
|
||||
width: 2rpx;
|
||||
height: 164rpx;
|
||||
top: 36rpx;
|
||||
left: 18rpx;
|
||||
}
|
||||
|
||||
&.cancelstatus-box-last {
|
||||
height: 80rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cancelstatus-btn {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
height: 150rpx;
|
||||
|
||||
button {
|
||||
width: 300rpx;
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 0 15rpx;
|
||||
border-radius: $border-radius;
|
||||
}
|
||||
|
||||
button[type='primary'] {
|
||||
background-color: unset !important;
|
||||
color: #333333;
|
||||
border: 2rpx solid #dddddd;
|
||||
}
|
||||
|
||||
button:nth-child(2) {
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,104 +1,104 @@
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="cancel-wrap">
|
||||
<view class="cancel-img">
|
||||
<image :src="$util.img('public/uniapp/member/success.png')" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="cancel-title">您已成功注销账号</view>
|
||||
<view class="cancel-reason">待下次与您更好的相遇,如需再次使用,请重新注册</view>
|
||||
<view class="cancel-btn"><button class="color-base-bg" @click="success">完成</button></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import memberPublic from './public/js/member-public.js';
|
||||
|
||||
export default {
|
||||
mixins: [memberPublic],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
state: ''
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
if (option.back) this.back = option.back;
|
||||
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getStatus();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getStatus() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/info',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
if (res.data && res.data.status == 1) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
success() {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cancel-wrap {
|
||||
padding-top: 84rpx;
|
||||
text-align: center;
|
||||
|
||||
.cancel-img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
display: inline-block;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.cancel-title {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
line-height: 24rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.cancel-reason {
|
||||
color: #838383;
|
||||
font-size: 20rpx;
|
||||
line-height: 40rpx;
|
||||
margin-top: 20rpx;
|
||||
padding: 0 175rpx;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
width: 100%;
|
||||
margin-top: 173rpx;
|
||||
|
||||
button {
|
||||
display: inline-block;
|
||||
width: 300rpx;
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 0 15rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="cancel-wrap">
|
||||
<view class="cancel-img">
|
||||
<image :src="$util.img('public/uniapp/member/success.png')" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="cancel-title">{{ $lang("member.cancelsuccess.l7") }}</view>
|
||||
<view class="cancel-reason">{{ $lang("member.cancelsuccess.l8") }}</view>
|
||||
<view class="cancel-btn"><button class="color-base-bg" @click="success">{{ $lang("common.pick-regions.l18.t0") }}</button></view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import memberPublic from './public/js/member-public.js';
|
||||
|
||||
export default {
|
||||
mixins: [memberPublic],
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
state: ''
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
|
||||
if (option.back) this.back = option.back;
|
||||
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getStatus();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getStatus() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/info',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
if (res.data && res.data.status == 1) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
success() {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cancel-wrap {
|
||||
padding-top: 84rpx;
|
||||
text-align: center;
|
||||
|
||||
.cancel-img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
display: inline-block;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.cancel-title {
|
||||
text-align: center;
|
||||
font-size: 24rpx;
|
||||
line-height: 24rpx;
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
|
||||
.cancel-reason {
|
||||
color: #838383;
|
||||
font-size: 20rpx;
|
||||
line-height: 40rpx;
|
||||
margin-top: 20rpx;
|
||||
padding: 0 175rpx;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
width: 100%;
|
||||
margin-top: 173rpx;
|
||||
|
||||
button {
|
||||
display: inline-block;
|
||||
width: 300rpx;
|
||||
height: 80rpx;
|
||||
font-size: 28rpx;
|
||||
line-height: 80rpx;
|
||||
margin: 0 15rpx;
|
||||
color: #ffffff;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,265 +1,265 @@
|
||||
<template>
|
||||
<view class="member-level" :style="themeColor">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/card-top-bg.png')"></image>
|
||||
</view>
|
||||
<view class="banner-container">
|
||||
<view class="memberInfo">
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg" @error="headimgError"
|
||||
mode="aspectFill" show-menu-by-longpress/>
|
||||
<image :src="$util.getDefaultImage().head" v-else mode="aspectFill" show-menu-by-longpress/>
|
||||
<view class="member-desc">
|
||||
<view class="font-size-toolbar">{{ memberInfo.nickname }}</view>
|
||||
<view class="font-size-tag expire-time" v-if="memberInfo.level_expire_time > 0">
|
||||
有效期至:{{ $util.timeStampTurnTime(memberInfo.level_expire_time, true) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="image-container item-center">
|
||||
<view class="slide-image">
|
||||
<view class="bg-border"></view>
|
||||
<image :src="$util.img('public/uniapp/level/card-bg.png')"></image>
|
||||
<view class="info">
|
||||
<view class="level-detail">{{ levelInfo.level_name }}</view>
|
||||
<view class="growr-name">{{ levelInfo.level_name }}可享受消费折扣和</view>
|
||||
<view class="growr-value">会员大礼包等权益</view>
|
||||
<view class="growth-rules font-size-tag" @click="openExplainPopup"
|
||||
v-if="levelInfo.remark != ''">
|
||||
<text class="iconfont icon-wenhao font-size-tag"></text>
|
||||
</view>
|
||||
<button type="default" class="renew-btn"
|
||||
@click="$util.redirectTo('/pages_tool/member/card_buy')">立即续费</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-content"
|
||||
v-if="levelInfo.is_free_shipping || levelInfo.consume_discount < 100 || levelInfo.point_feedback > 0">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">会员权益</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-privilege-list">
|
||||
<view class="card-privilege-item" v-if="levelInfo.is_free_shipping">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-tedianquanchangbaoyou"></text>
|
||||
</view>
|
||||
<view class="card-privilege-name">全场包邮</view>
|
||||
<view class="card-privilege-text">享受商品包邮服务</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="levelInfo.consume_discount < 100">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-zhekou"></text></view>
|
||||
<view class="card-privilege-name">消费折扣</view>
|
||||
<view class="card-privilege-text">部分商品下单可享{{ levelInfo.consume_discount / 10 }}折优惠</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="levelInfo.point_feedback > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-jifen2 f32"></text></view>
|
||||
<view class="card-privilege-name">积分回馈</view>
|
||||
<view class="card-privilege-text">下单享{{ parseFloat(levelInfo.point_feedback) }}倍积分回馈</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="levelInfo.send_coupon != '' || levelInfo.send_point > 0 || levelInfo.send_balance > 0">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">开卡礼包</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-privilege-list">
|
||||
<view class="card-privilege-item" v-if="levelInfo.send_point > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-jifen3"></text></view>
|
||||
<view class="card-privilege-name">积分礼包</view>
|
||||
<view class="card-privilege-text">赠送{{ levelInfo.send_point }}积分</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="levelInfo.send_balance > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-hongbao"></text></view>
|
||||
<view class="card-privilege-name">红包礼包</view>
|
||||
<view class="card-privilege-text">赠送{{ parseFloat(levelInfo.send_balance) }}元红包</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="levelInfo.send_coupon != ''">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-youhuiquan1"></text></view>
|
||||
<view class="card-privilege-name">优惠券礼包</view>
|
||||
<view class="card-privilege-text">赠送{{ levelInfo.send_coupon.split(',').length }}张优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 弹出规则 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="explainPopup" type="bottom">
|
||||
<view class="tips-layer">
|
||||
<view class="head" @click="closeExplainPopup()">
|
||||
<view class="title">会员卡说明</view>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="detail margin-bottom">
|
||||
<block v-if="levelInfo.remark != ''">
|
||||
<view class="tip">会员卡说明</view>
|
||||
<view class="font-size-base">{{ levelInfo.remark }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<ns-goods-recommend ref="goodrecommend" route="super_member"></ns-goods-recommend>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
export default {
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
isSub: false, // 是否已提交
|
||||
isIphoneX: false,
|
||||
levelId: 0,
|
||||
levelInfo: {
|
||||
bg_color: '#333'
|
||||
},
|
||||
mpShareData: null //小程序分享数据
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
//会员卡
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/card');
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
|
||||
let levelInfo = this.memberInfo.member_level_info;
|
||||
let charge_rule = levelInfo.charge_rule ? JSON.parse(levelInfo.charge_rule) : {};
|
||||
levelInfo.charge_rule_arr = [];
|
||||
Object.keys(charge_rule).forEach(key => {
|
||||
levelInfo.charge_rule_arr.push({
|
||||
key: key,
|
||||
value: charge_rule[key]
|
||||
});
|
||||
});
|
||||
this.levelInfo = levelInfo;
|
||||
},
|
||||
onShow() {
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare('/pages_tool/member/card').then(res => {
|
||||
this.mpShareData = res;
|
||||
}).catch(err => {
|
||||
// 如果后台没配置,用默认值
|
||||
this.mpShareData = {
|
||||
appMessage: {
|
||||
title: '专属会员权益,快来体验',
|
||||
path: '/pages_tool/member/card'
|
||||
},
|
||||
timeLine: {
|
||||
title: '专属会员权益,快来体验',
|
||||
query: '/pages_tool/member/card'
|
||||
}
|
||||
};
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
headimgError() {
|
||||
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
openExplainPopup() {
|
||||
this.$refs.explainPopup.open();
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
closeExplainPopup() {
|
||||
this.$refs.explainPopup.close();
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
return true;
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData?.appMessage || {
|
||||
title: '专属会员权益,快来体验',
|
||||
path: '/pages_tool/member/card'
|
||||
};
|
||||
},
|
||||
onShareTimeline() {
|
||||
return this.mpShareData?.timeLine || {
|
||||
title: '专属会员权益,快来体验',
|
||||
query: '/pages_tool/member/card'
|
||||
};
|
||||
},
|
||||
onAddToFavorites() {
|
||||
return {
|
||||
title: '专属会员权益,快来体验',
|
||||
path: '/pages_tool/member/card'
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/card.scss';
|
||||
|
||||
.banner-container .image-container .slide-image {
|
||||
width: calc(100% - 60rpx);
|
||||
height: 360rpx;
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.banner-container .image-container image {
|
||||
background-color: #e3b66b;
|
||||
}
|
||||
|
||||
.banner-container .slide-image .renew-btn {
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: $border-radius;
|
||||
width: 160rpx;
|
||||
font-size: $font-size-tag;
|
||||
color: #e3b66b !important;
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
bottom: 40rpx;
|
||||
border: none;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
<template>
|
||||
<view class="member-level" :style="themeColor">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/card-top-bg.png')"></image>
|
||||
</view>
|
||||
<view class="banner-container">
|
||||
<view class="memberInfo">
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg" @error="headimgError"
|
||||
mode="aspectFill" show-menu-by-longpress/>
|
||||
<image :src="$util.getDefaultImage().head" v-else mode="aspectFill" show-menu-by-longpress/>
|
||||
<view class="member-desc">
|
||||
<view class="font-size-toolbar">{{ memberInfo.nickname }}</view>
|
||||
<view class="font-size-tag expire-time" v-if="memberInfo.level_expire_time > 0">
|
||||
有效期至:{{ $util.timeStampTurnTime(memberInfo.level_expire_time, true) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="image-container item-center">
|
||||
<view class="slide-image">
|
||||
<view class="bg-border"></view>
|
||||
<image :src="$util.img('public/uniapp/level/card-bg.png')"></image>
|
||||
<view class="info">
|
||||
<view class="level-detail">{{ levelInfo.level_name }}</view>
|
||||
<view class="growr-name">{{ levelInfo.level_name }}可享受消费折扣和</view>
|
||||
<view class="growr-value">{{ $lang("member.card.l25") }}</view>
|
||||
<view class="growth-rules font-size-tag" @click="openExplainPopup"
|
||||
v-if="levelInfo.remark != ''">
|
||||
<text class="iconfont icon-wenhao font-size-tag"></text>
|
||||
</view>
|
||||
<button type="default" class="renew-btn"
|
||||
@click="$util.redirectTo('/pages_tool/member/card_buy')">{{ $lang("member.card.l31") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-content"
|
||||
v-if="levelInfo.is_free_shipping || levelInfo.consume_discount < 100 || levelInfo.point_feedback > 0">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">{{ $lang("member.card.l42") }}</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-privilege-list">
|
||||
<view class="card-privilege-item" v-if="levelInfo.is_free_shipping">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-tedianquanchangbaoyou"></text>
|
||||
</view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l52") }}</view>
|
||||
<view class="card-privilege-text">{{ $lang("member.card.l53") }}</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="levelInfo.consume_discount < 100">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-zhekou"></text></view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l57") }}</view>
|
||||
<view class="card-privilege-text">{ $lang("member.card.l58") } levelInfo.consume_discount / 10 }}折优惠</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="levelInfo.point_feedback > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-jifen2 f32"></text></view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l62") }}</view>
|
||||
<view class="card-privilege-text">{ $lang("member.card.l63") } parseFloat(levelInfo.point_feedback) }}倍积分回馈</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="levelInfo.send_coupon != '' || levelInfo.send_point > 0 || levelInfo.send_balance > 0">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">{{ $lang("member.card.l72") }}</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-privilege-list">
|
||||
<view class="card-privilege-item" v-if="levelInfo.send_point > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-jifen3"></text></view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l81") }}</view>
|
||||
<view class="card-privilege-text">{ $lang("member.card.l82") } levelInfo.send_point }}积分</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="levelInfo.send_balance > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-hongbao"></text></view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l86") }}</view>
|
||||
<view class="card-privilege-text">{ $lang("member.card.l82") } parseFloat(levelInfo.send_balance) }}元红包</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="levelInfo.send_coupon != ''">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-youhuiquan1"></text></view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l91") }}</view>
|
||||
<view class="card-privilege-text">{ $lang("member.card.l82") } levelInfo.send_coupon.split(',').length }}张优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 弹出规则 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="explainPopup" type="bottom">
|
||||
<view class="tips-layer">
|
||||
<view class="head" @click="closeExplainPopup()">
|
||||
<view class="title">{{ $lang("member.card.l104") }}</view>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="detail margin-bottom">
|
||||
<block v-if="levelInfo.remark != ''">
|
||||
<view class="tip">{{ $lang("member.card.l104") }}</view>
|
||||
<view class="font-size-base">{{ levelInfo.remark }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<ns-goods-recommend ref="goodrecommend" route="super_member"></ns-goods-recommend>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
export default {
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
isSub: false, // 是否已提交
|
||||
isIphoneX: false,
|
||||
levelId: 0,
|
||||
levelInfo: {
|
||||
bg_color: '#333'
|
||||
},
|
||||
mpShareData: null //小程序分享数据
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
//会员卡
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/card');
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
|
||||
let levelInfo = this.memberInfo.member_level_info;
|
||||
let charge_rule = levelInfo.charge_rule ? JSON.parse(levelInfo.charge_rule) : {};
|
||||
levelInfo.charge_rule_arr = [];
|
||||
Object.keys(charge_rule).forEach(key => {
|
||||
levelInfo.charge_rule_arr.push({
|
||||
key: key,
|
||||
value: charge_rule[key]
|
||||
});
|
||||
});
|
||||
this.levelInfo = levelInfo;
|
||||
},
|
||||
onShow() {
|
||||
//小程序分享
|
||||
// #ifdef MP-WEIXIN
|
||||
this.$util.getMpShare('/pages_tool/member/card').then(res => {
|
||||
this.mpShareData = res;
|
||||
}).catch(err => {
|
||||
// 如果后台没配置,用默认值
|
||||
this.mpShareData = {
|
||||
appMessage: {
|
||||
title: $lang('member.card.l174'),
|
||||
path: '/pages_tool/member/card'
|
||||
},
|
||||
timeLine: {
|
||||
title: $lang('member.card.l174'),
|
||||
query: '/pages_tool/member/card'
|
||||
}
|
||||
};
|
||||
});
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
headimgError() {
|
||||
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
openExplainPopup() {
|
||||
this.$refs.explainPopup.open();
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
closeExplainPopup() {
|
||||
this.$refs.explainPopup.close();
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
return true;
|
||||
},
|
||||
onShareAppMessage() {
|
||||
return this.mpShareData?.appMessage || {
|
||||
title: $lang('member.card.l174'),
|
||||
path: '/pages_tool/member/card'
|
||||
};
|
||||
},
|
||||
onShareTimeline() {
|
||||
return this.mpShareData?.timeLine || {
|
||||
title: $lang('member.card.l174'),
|
||||
query: '/pages_tool/member/card'
|
||||
};
|
||||
},
|
||||
onAddToFavorites() {
|
||||
return {
|
||||
title: $lang('member.card.l174'),
|
||||
path: '/pages_tool/member/card'
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/card.scss';
|
||||
|
||||
.banner-container .image-container .slide-image {
|
||||
width: calc(100% - 60rpx);
|
||||
height: 360rpx;
|
||||
background-size: 100% 100%;
|
||||
background-repeat: no-repeat;
|
||||
}
|
||||
|
||||
.banner-container .image-container image {
|
||||
background-color: #e3b66b;
|
||||
}
|
||||
|
||||
.banner-container .slide-image .renew-btn {
|
||||
text-align: center;
|
||||
line-height: 56rpx;
|
||||
height: 56rpx;
|
||||
border-radius: $border-radius;
|
||||
width: 160rpx;
|
||||
font-size: $font-size-tag;
|
||||
color: #e3b66b !important;
|
||||
background: #fff;
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
bottom: 40rpx;
|
||||
border: none;
|
||||
z-index: 10;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,429 +1,429 @@
|
||||
<template>
|
||||
<view class="member-level" :style="themeColor">
|
||||
<block v-if="levelList.length">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/card-top-bg.png')"></image>
|
||||
</view>
|
||||
<view class="banner-container">
|
||||
<view class="memberInfo">
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg" @error="headimgError"
|
||||
mode="aspectFill" show-menu-by-longpress/>
|
||||
<image :src="$util.getDefaultImage().head" v-else mode="aspectFill" show-menu-by-longpress></image>
|
||||
<view class="member-desc">
|
||||
<view class="font-size-toolbar">{{ memberInfo.nickname }}</view>
|
||||
<view class="font-size-tag expire-time" v-if="memberInfo.level_expire_time > 0">
|
||||
有效期至:{{ $util.timeStampTurnTime(memberInfo.level_expire_time, true) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<swiper :style="{ width: '100vw', height: '390rpx' }" class="margin-bottom"
|
||||
:indicator-dots="swiperConfig.indicatorDots" :indicator-color="swiperConfig.indicatorColor"
|
||||
:indicator-active-color="swiperConfig.indicatorActiveColor" :autoplay="false"
|
||||
:interval="swiperConfig.interval" :duration="swiperConfig.duration"
|
||||
:circular="swiperConfig.circular" :previous-margin="swiperConfig.previousMargin"
|
||||
:next-margin="swiperConfig.nextMargin" @change="swiperChange" @animationfinish="animationfinish"
|
||||
:current="curIndex">
|
||||
<swiper-item :class="levelList.length == 1 ? 'image-container-box' : ''"
|
||||
v-for="(item, i) in levelList" :key="i">
|
||||
<view class="image-container" :class="[
|
||||
curIndex === 0
|
||||
? i === listLen - 1
|
||||
? 'item-left'
|
||||
: i === 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
: curIndex === listLen - 1
|
||||
? i === 0
|
||||
? 'item-right'
|
||||
: i === listLen - 2
|
||||
? 'item-left'
|
||||
: 'item-center'
|
||||
: i === curIndex - 1
|
||||
? 'item-left'
|
||||
: i === curIndex + 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
]">
|
||||
<view class="slide-image" style="background-size: 100% 100%;background-repeat:no-repeat"
|
||||
:style="{
|
||||
transform: curIndex === i ? 'scale(' + scaleX + ',' + scaleY + ')' : 'scale(1,1)',
|
||||
transitionDuration: '.3s',
|
||||
transitionTimingFunction: 'ease'
|
||||
}">
|
||||
<view class="bg-border"></view>
|
||||
|
||||
<image v-if="levelList[curIndex] && levelList[curIndex]['level_picture']"
|
||||
:src="$util.img(levelList[curIndex]['level_picture'])" show-menu-by-longpress/>
|
||||
<image v-else :style="{ backgroundColor: levelList[curIndex]['bg_color'] }" />
|
||||
|
||||
<view class="info">
|
||||
<view class="level-detail" :style="{ color: levelList[curIndex]['level_text_color'] }">
|
||||
{{ levelList[curIndex].level_name }}</view>
|
||||
<view class="growr-name" :style="{ color: levelList[curIndex]['level_text_color'] }">{{
|
||||
levelList[curIndex].level_name }}可享受消费折扣和</view>
|
||||
<view class="growr-value" :style="{ color: levelList[curIndex]['level_text_color'] }">
|
||||
会员大礼包等权益</view>
|
||||
<view class="growth-rules font-size-tag" @click="openExplainPopup"
|
||||
v-if="levelList[curIndex].remark != ''">
|
||||
<text class="iconfont icon-wenhao font-size-tag"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<view class="card-content">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">卡种选择</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-time-list">
|
||||
<view class="card-item-box" :class="{ small: currCard.charge_rule_arr.length == 4 }"
|
||||
v-for="(item, index) in currCard.charge_rule_arr" :key="index">
|
||||
<view class="card-time-item" :class="{ active: choiceIndex == index }"
|
||||
@click="choice(index)">
|
||||
<image :src="$util.img('public/uniapp/level/card-icon.png')" mode="widthFix"></image>
|
||||
<view class="time-name">{{ cardType[item.key].name }}</view>
|
||||
<view class="time-price">
|
||||
{{ $lang('common.currencySymbol') }}
|
||||
<text class="price">{{ item.value }}</text>
|
||||
/{{ cardType[item.key].unit }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-content"
|
||||
v-if="currCard.is_free_shipping || currCard.consume_discount < 100 || currCard.point_feedback > 0">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">会员权益</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-privilege-list">
|
||||
<view class="card-privilege-item" v-if="currCard.is_free_shipping">
|
||||
<view class="card-privilege-icon">
|
||||
<text class="iconfont icon-tedianquanchangbaoyou"></text>
|
||||
</view>
|
||||
<view class="card-privilege-name">全场包邮</view>
|
||||
<view class="card-privilege-text">享受商品包邮服务</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.consume_discount < 100">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-zhekou"></text></view>
|
||||
<view class="card-privilege-name">消费折扣</view>
|
||||
<view class="card-privilege-text">部分商品下单可享{{ currCard.consume_discount / 10 }}折优惠</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.point_feedback > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-jifen2 f32"></text></view>
|
||||
<view class="card-privilege-name">积分回馈</view>
|
||||
<view class="card-privilege-text">下单享{{ parseFloat(currCard.point_feedback) }}倍积分回馈</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="currCard.send_coupon != '' || currCard.send_point > 0 || currCard.send_balance > 0">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">开卡礼包</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-privilege-list">
|
||||
<view class="card-privilege-item" v-if="currCard.send_point > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-jifen3"></text></view>
|
||||
<view class="card-privilege-name">积分礼包</view>
|
||||
<view class="card-privilege-text">赠送{{ currCard.send_point }}积分</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.send_balance > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-hongbao"></text></view>
|
||||
<view class="card-privilege-name">红包礼包</view>
|
||||
<view class="card-privilege-text">赠送{{ parseFloat(currCard.send_balance) }}元红包</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.send_coupon != ''">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-youhuiquan1"></text></view>
|
||||
<view class="card-privilege-name">优惠券礼包</view>
|
||||
<view class="card-privilege-text">赠送{{ currCard.send_coupon.split(',').length }}张优惠券
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<block v-if="currCard.charge_rule_arr.length">
|
||||
<view class="action-wrap" :class="{ 'bottom-safe-area': isIphoneX, 'have-agreement': agreement }">
|
||||
</view>
|
||||
<view class="action" :class="{ 'bottom-safe-area': isIphoneX, 'have-agreement': agreement }">
|
||||
<view class="action-btn" @click="create">
|
||||
<block v-if="currCard.level_id == levelId"><text class="bold title">立即续费</text></block>
|
||||
<block v-else>
|
||||
<text class="bold title" v-if="currCard.charge_type == 1">充值开通</text>
|
||||
<text class="bold title" v-else>立即开通</text>
|
||||
</block>
|
||||
<text class="font-size-tag">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="bold">{{ currCard.charge_rule_arr[choiceIndex].value }}</text>
|
||||
<text>/{{ cardType[currCard.charge_rule_arr[choiceIndex].key].unit }}</text>
|
||||
</view>
|
||||
<view class="agreement" v-if="agreement">
|
||||
购买既视为同意
|
||||
<text @click="$util.redirectTo('/pages_tool/member/card_agreement')">《{{ agreement.title
|
||||
}}》</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 弹出规则 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="explainPopup" type="bottom">
|
||||
<view class="tips-layer">
|
||||
<view class="head" @click="closeExplainPopup()">
|
||||
<view class="title">会员卡说明</view>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="detail margin-bottom">
|
||||
<block v-if="currCard.remark != ''">
|
||||
<view class="tip">会员卡说明</view>
|
||||
<view class="font-size-base">{{ currCard.remark }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<ns-payment ref="choosePaymentPopup" :payMoney="currCard.charge_rule_arr[choiceIndex].value"
|
||||
@confirm="toPay" v-if="currCard.charge_rule_arr.length"></ns-payment>
|
||||
</block>
|
||||
<block v-else><ns-empty text="暂无可开会员卡" :isIndex="false"></ns-empty></block>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<!-- 选择支付方式弹窗 -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
|
||||
export default {
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
isSub: false, // 是否已提交
|
||||
isIphoneX: false,
|
||||
couponPopList: [],
|
||||
curIndex: 0,
|
||||
isDescAnimating: false,
|
||||
scaleX: (634 / 540).toFixed(4),
|
||||
scaleY: (378 / 330).toFixed(4),
|
||||
swiperConfig: {
|
||||
indicatorDots: false,
|
||||
indicatorColor: 'rgba(255, 255, 255, .4)',
|
||||
indicatorActiveColor: 'rgba(255, 255, 255, 1)',
|
||||
interval: 3000,
|
||||
duration: 300,
|
||||
circular: false,
|
||||
previousMargin: '58rpx',
|
||||
nextMargin: '58rpx'
|
||||
},
|
||||
levelList: [],
|
||||
levelId: 0,
|
||||
cardType: {
|
||||
week: {
|
||||
name: '周卡',
|
||||
unit: '周'
|
||||
},
|
||||
month: {
|
||||
name: '月卡',
|
||||
unit: '月'
|
||||
},
|
||||
quarter: {
|
||||
name: '季卡',
|
||||
unit: '季'
|
||||
},
|
||||
year: {
|
||||
name: '年卡',
|
||||
unit: '年'
|
||||
}
|
||||
},
|
||||
choiceIndex: 0,
|
||||
outTradeNo: '',
|
||||
agreement: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
},
|
||||
currCard() {
|
||||
if (this.levelList[this.curIndex]) {
|
||||
let card = this.levelList[this.curIndex];
|
||||
let charge_rule = card.charge_rule ? JSON.parse(card.charge_rule) : {};
|
||||
card.charge_rule_arr = [];
|
||||
Object.keys(charge_rule).forEach(key => {
|
||||
card.charge_rule_arr.push({
|
||||
key: key,
|
||||
value: charge_rule[key]
|
||||
});
|
||||
});
|
||||
return card;
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
//会员卡
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
if (this.storeToken) {
|
||||
this.getCardList();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/card_buy');
|
||||
});
|
||||
}
|
||||
this.getAgreement();
|
||||
},
|
||||
onShow() { },
|
||||
watch: {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getCardList();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
this.curIndex = e.detail.current;
|
||||
this.choiceIndex = 0;
|
||||
this.isDescAnimating = true;
|
||||
},
|
||||
animationfinish(e) {
|
||||
this.isDescAnimating = false;
|
||||
},
|
||||
getCardList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/membercard/lists',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.levelList = res.data;
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
for (let i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].level_id == this.levelId) {
|
||||
this.curIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
choice(index) {
|
||||
this.choiceIndex = index;
|
||||
},
|
||||
/**
|
||||
* 创建
|
||||
*/
|
||||
create() {
|
||||
if (this.memberInfo.member_level_type && this.memberInfo.member_level != this.currCard.level_id) {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '您有尚未过期的会员卡,再次购卡会覆盖掉之前的卡,是否继续?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$refs.choosePaymentPopup.open();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs.choosePaymentPopup.open();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
toPay() {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/ordercreate/create',
|
||||
data: {
|
||||
level_id: this.currCard.level_id,
|
||||
period_unit: this.currCard.charge_rule_arr[this.choiceIndex].key
|
||||
},
|
||||
success: res => {
|
||||
if (res.data && res.code == 0) {
|
||||
this.outTradeNo = res.data.out_trade_no;
|
||||
uni.setStorageSync('paySource', 'membercard');
|
||||
this.$refs.choosePaymentPopup.getPayInfo(this.outTradeNo);
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
headimgError() {
|
||||
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
openExplainPopup() {
|
||||
this.$refs.explainPopup.open();
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
closeExplainPopup() {
|
||||
this.$refs.explainPopup.close();
|
||||
},
|
||||
getAgreement() {
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/membercard/agreement',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data && res.data.title != '' && res.data.content != '') {
|
||||
this.agreement = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/card.scss';
|
||||
<template>
|
||||
<view class="member-level" :style="themeColor">
|
||||
<block v-if="levelList.length">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/card-top-bg.png')"></image>
|
||||
</view>
|
||||
<view class="banner-container">
|
||||
<view class="memberInfo">
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg" @error="headimgError"
|
||||
mode="aspectFill" show-menu-by-longpress/>
|
||||
<image :src="$util.getDefaultImage().head" v-else mode="aspectFill" show-menu-by-longpress></image>
|
||||
<view class="member-desc">
|
||||
<view class="font-size-toolbar">{{ memberInfo.nickname }}</view>
|
||||
<view class="font-size-tag expire-time" v-if="memberInfo.level_expire_time > 0">
|
||||
有效期至:{{ $util.timeStampTurnTime(memberInfo.level_expire_time, true) }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<swiper :style="{ width: '100vw', height: '390rpx' }" class="margin-bottom"
|
||||
:indicator-dots="swiperConfig.indicatorDots" :indicator-color="swiperConfig.indicatorColor"
|
||||
:indicator-active-color="swiperConfig.indicatorActiveColor" :autoplay="false"
|
||||
:interval="swiperConfig.interval" :duration="swiperConfig.duration"
|
||||
:circular="swiperConfig.circular" :previous-margin="swiperConfig.previousMargin"
|
||||
:next-margin="swiperConfig.nextMargin" @change="swiperChange" @animationfinish="animationfinish"
|
||||
:current="curIndex">
|
||||
<swiper-item :class="levelList.length == 1 ? 'image-container-box' : ''"
|
||||
v-for="(item, i) in levelList" :key="i">
|
||||
<view class="image-container" :class="[
|
||||
curIndex === 0
|
||||
? i === listLen - 1
|
||||
? 'item-left'
|
||||
: i === 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
: curIndex === listLen - 1
|
||||
? i === 0
|
||||
? 'item-right'
|
||||
: i === listLen - 2
|
||||
? 'item-left'
|
||||
: 'item-center'
|
||||
: i === curIndex - 1
|
||||
? 'item-left'
|
||||
: i === curIndex + 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
]">
|
||||
<view class="slide-image" style="background-size: 100% 100%;background-repeat:no-repeat"
|
||||
:style="{
|
||||
transform: curIndex === i ? 'scale(' + scaleX + ',' + scaleY + ')' : 'scale(1,1)',
|
||||
transitionDuration: '.3s',
|
||||
transitionTimingFunction: 'ease'
|
||||
}">
|
||||
<view class="bg-border"></view>
|
||||
|
||||
<image v-if="levelList[curIndex] && levelList[curIndex]['level_picture']"
|
||||
:src="$util.img(levelList[curIndex]['level_picture'])" show-menu-by-longpress/>
|
||||
<image v-else :style="{ backgroundColor: levelList[curIndex]['bg_color'] }" />
|
||||
|
||||
<view class="info">
|
||||
<view class="level-detail" :style="{ color: levelList[curIndex]['level_text_color'] }">
|
||||
{{ levelList[curIndex].level_name }}</view>
|
||||
<view class="growr-name" :style="{ color: levelList[curIndex]['level_text_color'] }">{{
|
||||
levelList[curIndex].level_name }}可享受消费折扣和</view>
|
||||
<view class="growr-value" :style="{ color: levelList[curIndex]['level_text_color'] }">
|
||||
会员大礼包等权益</view>
|
||||
<view class="growth-rules font-size-tag" @click="openExplainPopup"
|
||||
v-if="levelList[curIndex].remark != ''">
|
||||
<text class="iconfont icon-wenhao font-size-tag"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
|
||||
<view class="card-content">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">{{ $lang("member.card_buy.l81") }}</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-time-list">
|
||||
<view class="card-item-box" :class="{ small: currCard.charge_rule_arr.length == 4 }"
|
||||
v-for="(item, index) in currCard.charge_rule_arr" :key="index">
|
||||
<view class="card-time-item" :class="{ active: choiceIndex == index }"
|
||||
@click="choice(index)">
|
||||
<image :src="$util.img('public/uniapp/level/card-icon.png')" mode="widthFix"></image>
|
||||
<view class="time-name">{{ cardType[item.key].name }}</view>
|
||||
<view class="time-price">
|
||||
{{ $lang('common.currency_symbol') }}
|
||||
<text class="price">{{ item.value }}</text>
|
||||
/{{ cardType[item.key].unit }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="card-content"
|
||||
v-if="currCard.is_free_shipping || currCard.consume_discount < 100 || currCard.point_feedback > 0">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">{{ $lang("member.card.l42") }}</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-privilege-list">
|
||||
<view class="card-privilege-item" v-if="currCard.is_free_shipping">
|
||||
<view class="card-privilege-icon">
|
||||
<text class="iconfont icon-tedianquanchangbaoyou"></text>
|
||||
</view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l52") }}</view>
|
||||
<view class="card-privilege-text">{{ $lang("member.card.l53") }}</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.consume_discount < 100">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-zhekou"></text></view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l57") }}</view>
|
||||
<view class="card-privilege-text">{ $lang("member.card.l58") } currCard.consume_discount / 10 }}折优惠</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.point_feedback > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-jifen2 f32"></text></view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l62") }}</view>
|
||||
<view class="card-privilege-text">{ $lang("member.card.l63") } parseFloat(currCard.point_feedback) }}倍积分回馈</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-if="currCard.send_coupon != '' || currCard.send_point > 0 || currCard.send_balance > 0">
|
||||
<view class="card-content-head">
|
||||
<view class="line-box">
|
||||
<view class="line right"></view>
|
||||
</view>
|
||||
<view class="card-content-title">{{ $lang("member.card.l72") }}</view>
|
||||
<view class="line-box">
|
||||
<view class="line"></view>
|
||||
</view>
|
||||
<view class="clear"></view>
|
||||
</view>
|
||||
<view class="card-privilege-list">
|
||||
<view class="card-privilege-item" v-if="currCard.send_point > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-jifen3"></text></view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l81") }}</view>
|
||||
<view class="card-privilege-text">{ $lang("member.card.l82") } currCard.send_point }}积分</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.send_balance > 0">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-hongbao"></text></view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l86") }}</view>
|
||||
<view class="card-privilege-text">{ $lang("member.card.l82") } parseFloat(currCard.send_balance) }}元红包</view>
|
||||
</view>
|
||||
<view class="card-privilege-item" v-if="currCard.send_coupon != ''">
|
||||
<view class="card-privilege-icon"><text class="iconfont icon-youhuiquan1"></text></view>
|
||||
<view class="card-privilege-name">{{ $lang("member.card.l91") }}</view>
|
||||
<view class="card-privilege-text">赠送{{ currCard.send_coupon.split(',').length }}张优惠券
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<block v-if="currCard.charge_rule_arr.length">
|
||||
<view class="action-wrap" :class="{ 'bottom-safe-area': isIphoneX, 'have-agreement': agreement }">
|
||||
</view>
|
||||
<view class="action" :class="{ 'bottom-safe-area': isIphoneX, 'have-agreement': agreement }">
|
||||
<view class="action-btn" @click="create">
|
||||
<block v-if="currCard.level_id == levelId"><text class="bold title">{{ $lang("member.card.l31") }}</text></block>
|
||||
<block v-else>
|
||||
<text class="bold title" v-if="currCard.charge_type == 1">{{ $lang("member.card_buy.l175") }}</text>
|
||||
<text class="bold title" v-else>{{ $lang("diy.diy-member-info.l125.t0") }}</text>
|
||||
</block>
|
||||
<text class="font-size-tag">{{ $lang('common.currency_symbol') }}</text>
|
||||
<text class="bold">{{ currCard.charge_rule_arr[choiceIndex].value }}</text>
|
||||
<text>/{{ cardType[currCard.charge_rule_arr[choiceIndex].key].unit }}</text>
|
||||
</view>
|
||||
<view class="agreement" v-if="agreement">
|
||||
购买既视为同意
|
||||
<text @click="$util.redirectTo('/pages_tool/member/card_agreement')">《{{ agreement.title
|
||||
}}》</text>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<!-- 弹出规则 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="explainPopup" type="bottom">
|
||||
<view class="tips-layer">
|
||||
<view class="head" @click="closeExplainPopup()">
|
||||
<view class="title">{{ $lang("member.card.l104") }}</view>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="detail margin-bottom">
|
||||
<block v-if="currCard.remark != ''">
|
||||
<view class="tip">{{ $lang("member.card.l104") }}</view>
|
||||
<view class="font-size-base">{{ currCard.remark }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<ns-payment ref="choosePaymentPopup" :payMoney="currCard.charge_rule_arr[choiceIndex].value"
|
||||
@confirm="toPay" v-if="currCard.charge_rule_arr.length"></ns-payment>
|
||||
</block>
|
||||
<block v-else><ns-empty text="暂无可开会员卡" :isIndex="false"></ns-empty></block>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<!-- 选择支付方式弹窗 -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
|
||||
export default {
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
isSub: false, // 是否已提交
|
||||
isIphoneX: false,
|
||||
couponPopList: [],
|
||||
curIndex: 0,
|
||||
isDescAnimating: false,
|
||||
scaleX: (634 / 540).toFixed(4),
|
||||
scaleY: (378 / 330).toFixed(4),
|
||||
swiperConfig: {
|
||||
indicatorDots: false,
|
||||
indicatorColor: 'rgba(255, 255, 255, .4)',
|
||||
indicatorActiveColor: 'rgba(255, 255, 255, 1)',
|
||||
interval: 3000,
|
||||
duration: 300,
|
||||
circular: false,
|
||||
previousMargin: '58rpx',
|
||||
nextMargin: '58rpx'
|
||||
},
|
||||
levelList: [],
|
||||
levelId: 0,
|
||||
cardType: {
|
||||
week: {
|
||||
name: $lang('order._components.common-payment.payment.l134.t0'),
|
||||
unit: $lang('order._components.common-payment.payment.l135.t0')
|
||||
},
|
||||
month: {
|
||||
name: $lang('order._components.common-payment.payment.l142.t0'),
|
||||
unit: $lang('common.ns-select-time.l96.t0')
|
||||
},
|
||||
quarter: {
|
||||
name: $lang('order._components.common-payment.payment.l150.t0'),
|
||||
unit: $lang('order._components.common-payment.payment.l151.t0')
|
||||
},
|
||||
year: {
|
||||
name: $lang('order._components.common-payment.payment.l158.t0'),
|
||||
unit: $lang('order._components.common-payment.payment.l159.t0')
|
||||
}
|
||||
},
|
||||
choiceIndex: 0,
|
||||
outTradeNo: '',
|
||||
agreement: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
},
|
||||
currCard() {
|
||||
if (this.levelList[this.curIndex]) {
|
||||
let card = this.levelList[this.curIndex];
|
||||
let charge_rule = card.charge_rule ? JSON.parse(card.charge_rule) : {};
|
||||
card.charge_rule_arr = [];
|
||||
Object.keys(charge_rule).forEach(key => {
|
||||
card.charge_rule_arr.push({
|
||||
key: key,
|
||||
value: charge_rule[key]
|
||||
});
|
||||
});
|
||||
return card;
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
//会员卡
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
|
||||
if (this.storeToken) {
|
||||
this.getCardList();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/card_buy');
|
||||
});
|
||||
}
|
||||
this.getAgreement();
|
||||
},
|
||||
onShow() { },
|
||||
watch: {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getCardList();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
this.curIndex = e.detail.current;
|
||||
this.choiceIndex = 0;
|
||||
this.isDescAnimating = true;
|
||||
},
|
||||
animationfinish(e) {
|
||||
this.isDescAnimating = false;
|
||||
},
|
||||
getCardList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/membercard/lists',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data) {
|
||||
this.levelList = res.data;
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
for (let i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].level_id == this.levelId) {
|
||||
this.curIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
choice(index) {
|
||||
this.choiceIndex = index;
|
||||
},
|
||||
/**
|
||||
* 创建
|
||||
*/
|
||||
create() {
|
||||
if (this.memberInfo.member_level_type && this.memberInfo.member_level != this.currCard.level_id) {
|
||||
uni.showModal({
|
||||
title: $lang('common.wxwork-contact.l202.t0'),
|
||||
content: $lang('member.card_buy.l353'),
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$refs.choosePaymentPopup.open();
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$refs.choosePaymentPopup.open();
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 提交
|
||||
*/
|
||||
toPay() {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/ordercreate/create',
|
||||
data: {
|
||||
level_id: this.currCard.level_id,
|
||||
period_unit: this.currCard.charge_rule_arr[this.choiceIndex].key
|
||||
},
|
||||
success: res => {
|
||||
if (res.data && res.code == 0) {
|
||||
this.outTradeNo = res.data.out_trade_no;
|
||||
uni.setStorageSync('paySource', 'membercard');
|
||||
this.$refs.choosePaymentPopup.getPayInfo(this.outTradeNo);
|
||||
} else {
|
||||
this.isSub = false;
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
headimgError() {
|
||||
this.memberInfo.headimg = this.$util.getDefaultImage().head;
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
openExplainPopup() {
|
||||
this.$refs.explainPopup.open();
|
||||
},
|
||||
/**
|
||||
* 打开说明弹出层
|
||||
*/
|
||||
closeExplainPopup() {
|
||||
this.$refs.explainPopup.close();
|
||||
},
|
||||
getAgreement() {
|
||||
this.$api.sendRequest({
|
||||
url: '/supermember/api/membercard/agreement',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data && res.data.title != '' && res.data.content != '') {
|
||||
this.agreement = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
return true;
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/card.scss';
|
||||
</style>
|
||||
@@ -1,92 +1,92 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8" @listenRefresh="listenRefresh">
|
||||
<block class="goods_list" slot="list">
|
||||
<block v-if="collectionList.length > 0">
|
||||
<view class="goods_li margin-top" v-for="(item, index) in collectionList" :key="index"
|
||||
@click.stop="toDetail(item)">
|
||||
<view class="pic">
|
||||
<image :src="$util.img(item.goods_image.split(',')[0], { size: 'mid' })" mode="aspectFill"
|
||||
@error="goodsImageError(index)" show-menu-by-longpress ></image>
|
||||
</view>
|
||||
<view class="goods_info">
|
||||
<view class="goods_name font-size-base">{{ item.sku_name }}</view>
|
||||
<view class="goods_opection">
|
||||
<view class="left lineheight-clear ">
|
||||
<text class="symbol price-style small">¥</text>
|
||||
<text class="price price-style large">{{
|
||||
parseFloat(item.discount_price).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="symbol price-style small">.{{
|
||||
parseFloat(item.discount_price).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="cars" @click.stop="deleteItem(item.goods_id)">
|
||||
<view class="icon iconfont icon-icon7"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 第一个列表为空时 -->
|
||||
<view class="collection-empty" v-else>
|
||||
<ns-empty v-if="collectionList.length == 0 && isShowEmpty" text="暂无关注的商品" subText="赶紧去逛逛, 关注心仪的商品吧"
|
||||
:isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||
@click="toLogin">{{ $lang('toLogin') }}</button>
|
||||
</view>
|
||||
|
||||
<ns-goods-recommend ref="goodsRecommend"></ns-goods-recommend>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import common from './public/js/common.js';
|
||||
import collection from './public/js/collection.js';
|
||||
|
||||
export default {
|
||||
mixins: [common, collection],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.loadingCover.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
::v-deep .empty {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
@import './public/css/collection.scss';
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8" @listenRefresh="listenRefresh">
|
||||
<block class="goods_list" slot="list">
|
||||
<block v-if="collectionList.length > 0">
|
||||
<view class="goods_li margin-top" v-for="(item, index) in collectionList" :key="index"
|
||||
@click.stop="toDetail(item)">
|
||||
<view class="pic">
|
||||
<image :src="$util.img(item.goods_image.split(',')[0], { size: 'mid' })" mode="aspectFill"
|
||||
@error="goodsImageError(index)" show-menu-by-longpress ></image>
|
||||
</view>
|
||||
<view class="goods_info">
|
||||
<view class="goods_name font-size-base">{{ item.sku_name }}</view>
|
||||
<view class="goods_opection">
|
||||
<view class="left lineheight-clear ">
|
||||
<text class="symbol price-style small">¥</text>
|
||||
<text class="price price-style large">{{
|
||||
parseFloat(item.discount_price).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="symbol price-style small">.{{
|
||||
parseFloat(item.discount_price).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="right">
|
||||
<view class="cars" @click.stop="deleteItem(item.goods_id)">
|
||||
<view class="icon iconfont icon-icon7"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<!-- 第一个列表为空时 -->
|
||||
<view class="collection-empty" v-else>
|
||||
<ns-empty v-if="collectionList.length == 0 && isShowEmpty" text=$lang("member.collection.l33") subText=$lang("member.collection.l33")
|
||||
:isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('common.empty.goShopping'), url: '/pages_goods/category' }"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||
@click="toLogin">{{ $lang('login.list.to_login') }}</button>
|
||||
</view>
|
||||
|
||||
<ns-goods-recommend ref="goodsRecommend"></ns-goods-recommend>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import common from './public/js/common.js';
|
||||
import collection from './public/js/collection.js';
|
||||
|
||||
export default {
|
||||
mixins: [common, collection],
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.loadingCover.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function (nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
::v-deep .empty {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
@import './public/css/collection.scss';
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
</style>
|
||||
@@ -1,28 +1,28 @@
|
||||
<template>
|
||||
<view class="contact" :style="themeColor">
|
||||
<image :src="$util.img('public/uniapp/member/contact_service.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<!--<ns-contact><button type="primary">联系客服</button></ns-contact>-->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onLoad(options) {},
|
||||
onShow() {},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.contact {
|
||||
width: 80%;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
image {
|
||||
width: 500rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="contact" :style="themeColor">
|
||||
<image :src="$util.img('public/uniapp/member/contact_service.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<!--<ns-contact><button type="primary">{{ $lang("common.ns-contact.l32.t0") }}</button></ns-contact>-->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onLoad(options) {},
|
||||
onShow() {},
|
||||
methods: {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.contact {
|
||||
width: 80%;
|
||||
text-align: center;
|
||||
margin: 0 auto;
|
||||
image {
|
||||
width: 500rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,401 +1,401 @@
|
||||
<template>
|
||||
<view :style="themeColor" :class="isIphoneX ? 'iphone-x' : ''">
|
||||
<view class="cf-container color-line-border" v-if="storeToken">
|
||||
<view class="tab">
|
||||
<view @click="changeState(1)"><text :class="state == 1 ? 'color-base-text active color-base-border-bottom' : ''">未使用</text></view>
|
||||
<view @click="changeState(2)"><text :class="state == 2 ? 'color-base-text active color-base-border-bottom' : ''">已使用</text></view>
|
||||
<view @click="changeState(3)"><text :class="state == 3 ? 'color-base-text active color-base-border-bottom' : ''">已过期</text></view>
|
||||
</view>
|
||||
<!-- <view class="coupon-head">
|
||||
<view class="sort" :class="sort == 1 ? 'color-base-border color-base-text' : ''" @click="changeSort(1, '')">全部</view>
|
||||
<view class="sort" :class="sort == 2 ? 'color-base-border color-base-text' : ''" @click="changeSort(2, 'reward')">满减券</view>
|
||||
<view class="sort" :class="sort == 3 ? 'color-base-border color-base-text' : ''" @click="changeSort(3, 'discount')">折扣券</view>
|
||||
<view class="sort" :class="sort == 4 ? 'color-base-border color-base-text' : ''" @click="changeSort(4, 'no_threshold')">无门槛券</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<mescroll-uni ref="mescroll" top="100" @getData="getMemberCounponList" v-if="storeToken">
|
||||
<block slot="list">
|
||||
<view class="coupon-listone">
|
||||
<view class="item" :class="['item',item.state != 1&&'item-disabled']" v-for="(item, index) in list" :key="index" @click="toGoodsList(item)" :style="{ backgroundColor: item.state != 1 ? '#FFF' : 'var(--main-color-shallow)' }">
|
||||
<view class="item-base">
|
||||
<image class="coupon-line" mode="heightFix" :src="$util.img('public/uniapp/coupon/coupon_line.png')" show-menu-by-longpress/>
|
||||
<view>
|
||||
<view class="use_price " v-if="item.type == 'divideticket'">
|
||||
<text>¥</text>
|
||||
{{ parseFloat(item.money) }}
|
||||
</view>
|
||||
<view class="use_price " v-if="item.type == 'reward'">
|
||||
<text>¥</text>
|
||||
{{ parseFloat(item.money) }}
|
||||
</view>
|
||||
<view class="use_price" v-else-if="item.type == 'discount'">
|
||||
{{ parseFloat(item.discount) }}
|
||||
<text>折</text>
|
||||
</view>
|
||||
<view class="use_condition font-size-tag" v-if="item.at_least > 0">
|
||||
满{{ item.at_least }}元可用</view>
|
||||
<view class="use_condition font-size-tag" v-else>无门槛优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-info">
|
||||
<view class="use_title">
|
||||
<view class="title">{{ item.coupon_name }}</view>
|
||||
<view class="max_price" v-if="item.goods_type == 2 || item.goods_type == 3" :class="{ disabled: item.state == 3 }">指定商品</view>
|
||||
<view class="max_price" v-if="item.discount_limit != '0.00'">(最大优惠{{ item.discount_limit }}元)</view>
|
||||
<view class="max_price" :class="{ disabled: item.useState == 2 }">{{ item.use_channel_name }}</view>
|
||||
<!-- <view class="max_price truncate" v-if="item.use_channel!='online'" :class="{ disabled: item.useState == 2 }">
|
||||
{{ item.use_store==='all'?'适用门店:全部门店': '适用门店:'+item.use_store_name}}
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="use_time" v-if="item.end_time">有效期:{{ $util.timeStampTurnTime(item.end_time) }}
|
||||
</view>
|
||||
<view class="use_time" v-else>有效期:长期有效</view>
|
||||
</view>
|
||||
<view class="item-btn">
|
||||
<view class="tag" v-if="item.state == 1">去使用</view>
|
||||
<view class="tag disabled" v-if="item.state == 2">已使用</view>
|
||||
<view class="tag disabled" v-if="item.state == 3">已过期</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!list.length && showEmpty" class="margin-top cart-empty" :fixed="false">
|
||||
<ns-empty :isIndex="true" :emptyBtn="{url: $util.INDEX_PAGE_URL,text: '去逛逛'}" text="暂无优惠券"></ns-empty>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<ns-login ref="ns-login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
type: '',
|
||||
types: '',
|
||||
state: 1,
|
||||
sort: 1,
|
||||
list: [],
|
||||
isIphoneX: false, //判断手机是否是iphoneX以上
|
||||
showEmpty: false,
|
||||
related_id: 0
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.coupon) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启优惠券',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
if (data.related_id) this.related_id = data.related_id ? data.related_id : 0;
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/coupon');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//切换状态
|
||||
changeState(state) {
|
||||
this.list = [];
|
||||
this.state = state;
|
||||
this.$refs.mescroll.refresh(false);
|
||||
},
|
||||
changeSort(sort, types) {
|
||||
this.list = [];
|
||||
this.sort = sort;
|
||||
this.types = types;
|
||||
this.$refs.mescroll.refresh(false);
|
||||
},
|
||||
getMemberCounponList(mescroll) {
|
||||
this.showEmpty = false;
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/memberpage',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
state: this.state,
|
||||
is_own: this.type,
|
||||
type: this.types,
|
||||
related_id: this.related_id
|
||||
},
|
||||
success: res => {
|
||||
this.showEmpty = true;
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) {
|
||||
this.list = []; //如果是第一页需手动制空列表
|
||||
this.related_id = 0;
|
||||
}
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
let data = res.data;
|
||||
if (data) this.couponList = data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.list[index].logo = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
toGoodsList(item) {
|
||||
if (item.state == 1) {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
coupon: item.coupon_type_id
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cart-empty {
|
||||
margin-top: 208rpx !important;
|
||||
}
|
||||
|
||||
.active {
|
||||
border-bottom: 4rpx solid;
|
||||
}
|
||||
|
||||
.coupon-head {
|
||||
display: flex;
|
||||
background: #fff;
|
||||
padding: 20rpx 50rpx;
|
||||
|
||||
.sort {
|
||||
border: 2rpx solid #c5c5c5;
|
||||
padding: 1rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
cursor: pointer;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cf-container {
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.tab {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 86rpx;
|
||||
|
||||
>view {
|
||||
text-align: center;
|
||||
width: 33%;
|
||||
height: 86rpx;
|
||||
|
||||
text {
|
||||
display: inline-block;
|
||||
line-height: 86rpx;
|
||||
height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-listone {
|
||||
margin: 0 30rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
background-color: #fff2f0;
|
||||
background-size: 100% 100%;
|
||||
border-radius: 20rpx;
|
||||
align-items: stretch;
|
||||
margin-top: $padding;
|
||||
overflow: hidden;
|
||||
|
||||
&.item-disabled {
|
||||
.item-base {
|
||||
background: #e7e7e7 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.item-base {
|
||||
position: relative;
|
||||
width: 197rpx;
|
||||
min-width: 197rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(to left, var(--bg-color), var(--bg-color-shallow));
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 38rpx 10rpx 38rpx 18rpx;
|
||||
|
||||
&.disabled {
|
||||
background: #dedede;
|
||||
}
|
||||
|
||||
.coupon-line {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
>view {
|
||||
width: calc(100%);
|
||||
height: auto;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
|
||||
.use_price {
|
||||
font-size: 60rpx;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.use_condition {
|
||||
color: #fff;
|
||||
margin-top: $padding;
|
||||
|
||||
&.margin_top_none {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: #f8f8f8;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
height: 30rpx;
|
||||
width: 15rpx;
|
||||
border-radius: 0 30rpx 30rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.item-btn {
|
||||
position: relative;
|
||||
width: 160rpx;
|
||||
min-width: 160rpx;
|
||||
align-self: center;
|
||||
|
||||
view {
|
||||
width: 100rpx;
|
||||
height: 50rpx;
|
||||
border-radius: $border-radius;
|
||||
line-height: 50rpx;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
background-image: linear-gradient(to right, var(--bg-color), var(--bg-color-shallow));
|
||||
color: var(--btn-text-color);
|
||||
;
|
||||
font-size: $font-size-tag;
|
||||
|
||||
&.disabled {
|
||||
background: $color-line !important;
|
||||
color: $color-tip !important;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: #f8f8f8;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
height: 30rpx;
|
||||
width: 15rpx;
|
||||
border-radius: 30rpx 0 0 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-left: $padding;
|
||||
overflow: hidden;
|
||||
background-repeat-x: no-repeat;
|
||||
background-repeat-y: repeat;
|
||||
|
||||
.use_time {
|
||||
padding: $padding 0;
|
||||
border-top: 2rpx dashed #cccccc;
|
||||
font-size: $font-size-activity-tag;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.use_title {
|
||||
font-size: $font-size-base;
|
||||
font-weight: 500;
|
||||
padding: $padding 0;
|
||||
|
||||
.title {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.max_price {
|
||||
font-weight: 400;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.truncate {
|
||||
overflow: hidden;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor" :class="isIphoneX ? 'iphone-x' : ''">
|
||||
<view class="cf-container color-line-border" v-if="storeToken">
|
||||
<view class="tab">
|
||||
<view @click="changeState(1)"><text :class="state == 1 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang("member.coupon.l5") }}</text></view>
|
||||
<view @click="changeState(2)"><text :class="state == 2 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang("member.coupon.l6") }}</text></view>
|
||||
<view @click="changeState(3)"><text :class="state == 3 ? 'color-base-text active color-base-border-bottom' : ''">{{ $lang("tool.goods.coupon.l65.t0") }}</text></view>
|
||||
</view>
|
||||
<!-- <view class="coupon-head">
|
||||
<view class="sort" :class="sort == 1 ? 'color-base-border color-base-text' : ''" @click="changeSort(1, '')">{{ $lang("diy.diy-category-item.l47.t0") }}</view>
|
||||
<view class="sort" :class="sort == 2 ? 'color-base-border color-base-text' : ''" @click="changeSort(2, 'reward')">{{ $lang("tool.goods.coupon.l8.t0") }}</view>
|
||||
<view class="sort" :class="sort == 3 ? 'color-base-border color-base-text' : ''" @click="changeSort(3, 'discount')">{{ $lang("tool.goods.coupon.l10.t0") }}</view>
|
||||
<view class="sort" :class="sort == 4 ? 'color-base-border color-base-text' : ''" @click="changeSort(4, 'no_threshold')">{{ $lang("tool.goods.coupon.l11.t0") }}</view>
|
||||
</view> -->
|
||||
</view>
|
||||
|
||||
<mescroll-uni ref="mescroll" top="100" @getData="getMemberCounponList" v-if="storeToken">
|
||||
<block slot="list">
|
||||
<view class="coupon-listone">
|
||||
<view class="item" :class="['item',item.state != 1&&'item-disabled']" v-for="(item, index) in list" :key="index" @click="toGoodsList(item)" :style="{ backgroundColor: item.state != 1 ? '#FFF' : 'var(--main-color-shallow)' }">
|
||||
<view class="item-base">
|
||||
<image class="coupon-line" mode="heightFix" :src="$util.img('public/uniapp/coupon/coupon_line.png')" show-menu-by-longpress/>
|
||||
<view>
|
||||
<view class="use_price " v-if="item.type == 'divideticket'">
|
||||
<text>¥</text>
|
||||
{{ parseFloat(item.money) }}
|
||||
</view>
|
||||
<view class="use_price " v-if="item.type == 'reward'">
|
||||
<text>¥</text>
|
||||
{{ parseFloat(item.money) }}
|
||||
</view>
|
||||
<view class="use_price" v-else-if="item.type == 'discount'">
|
||||
{{ parseFloat(item.discount) }}
|
||||
<text>{{ $lang("common.register-reward.l60.t1") }}</text>
|
||||
</view>
|
||||
<view class="use_condition font-size-tag" v-if="item.at_least > 0">
|
||||
满{{ item.at_least }}元可用</view>
|
||||
<view class="use_condition font-size-tag" v-else>{{ $lang("diy.diy-coupon.l32.t2") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-info">
|
||||
<view class="use_title">
|
||||
<view class="title">{{ item.coupon_name }}</view>
|
||||
<view class="max_price" v-if="item.goods_type == 2 || item.goods_type == 3" :class="{ disabled: item.state == 3 }">{{ $lang("tool.goods.coupon.l44.t0") }}</view>
|
||||
<view class="max_price" v-if="item.discount_limit != '0.00'">{ $lang("member.coupon.l45") } item.discount_limit }}元)</view>
|
||||
<view class="max_price" :class="{ disabled: item.useState == 2 }">{{ item.use_channel_name }}</view>
|
||||
<!-- <view class="max_price truncate" v-if="item.use_channel!='online'" :class="{ disabled: item.useState == 2 }">
|
||||
{{ item.use_store==='all'?'适用门店:全部门店': $lang('tool.goods.coupon.l52.t1')+item.use_store_name}}
|
||||
</view> -->
|
||||
</view>
|
||||
<view class="use_time" v-if="item.end_time">有效期:{{ $util.timeStampTurnTime(item.end_time) }}
|
||||
</view>
|
||||
<view class="use_time" v-else>{{ $lang("goods.cart.l294") }}</view>
|
||||
</view>
|
||||
<view class="item-btn">
|
||||
<view class="tag" v-if="item.state == 1">{{ $lang("diy.diy-coupon.l38.t0") }}</view>
|
||||
<view class="tag disabled" v-if="item.state == 2">{{ $lang("member.coupon.l6") }}</view>
|
||||
<view class="tag disabled" v-if="item.state == 3">{{ $lang("tool.goods.coupon.l65.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="!list.length && showEmpty" class="margin-top cart-empty" :fixed="false">
|
||||
<ns-empty :isIndex="true" :emptyBtn="{url: $util.INDEX_PAGE_URL,text: '去逛逛'}" text=$lang("diy.diy-coupon.l241.t0")></ns-empty>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<ns-login ref="ns-login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
type: '',
|
||||
types: '',
|
||||
state: 1,
|
||||
sort: 1,
|
||||
list: [],
|
||||
isIphoneX: false, //判断手机是否是iphoneX以上
|
||||
showEmpty: false,
|
||||
related_id: 0
|
||||
};
|
||||
},
|
||||
onLoad(data) {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.coupon) {
|
||||
this.$util.showToast({
|
||||
title: $lang('tool.goods.coupon.l102.t0'),
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
if (data.related_id) this.related_id = data.related_id ? data.related_id : 0;
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/coupon');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//切换状态
|
||||
changeState(state) {
|
||||
this.list = [];
|
||||
this.state = state;
|
||||
this.$refs.mescroll.refresh(false);
|
||||
},
|
||||
changeSort(sort, types) {
|
||||
this.list = [];
|
||||
this.sort = sort;
|
||||
this.types = types;
|
||||
this.$refs.mescroll.refresh(false);
|
||||
},
|
||||
getMemberCounponList(mescroll) {
|
||||
this.showEmpty = false;
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/memberpage',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size,
|
||||
state: this.state,
|
||||
is_own: this.type,
|
||||
type: this.types,
|
||||
related_id: this.related_id
|
||||
},
|
||||
success: res => {
|
||||
this.showEmpty = true;
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) {
|
||||
this.list = []; //如果是第一页需手动制空列表
|
||||
this.related_id = 0;
|
||||
}
|
||||
this.list = this.list.concat(newArr); //追加新数据
|
||||
let data = res.data;
|
||||
if (data) this.couponList = data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.list[index].logo = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
toGoodsList(item) {
|
||||
if (item.state == 1) {
|
||||
this.$util.redirectTo('/pages_goods/list', {
|
||||
coupon: item.coupon_type_id
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.cart-empty {
|
||||
margin-top: 208rpx !important;
|
||||
}
|
||||
|
||||
.active {
|
||||
border-bottom: 4rpx solid;
|
||||
}
|
||||
|
||||
.coupon-head {
|
||||
display: flex;
|
||||
background: #fff;
|
||||
padding: 20rpx 50rpx;
|
||||
|
||||
.sort {
|
||||
border: 2rpx solid #c5c5c5;
|
||||
padding: 1rpx 20rpx;
|
||||
border-radius: 10rpx;
|
||||
cursor: pointer;
|
||||
margin-right: 15rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cf-container {
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.tab {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 86rpx;
|
||||
|
||||
>view {
|
||||
text-align: center;
|
||||
width: 33%;
|
||||
height: 86rpx;
|
||||
|
||||
text {
|
||||
display: inline-block;
|
||||
line-height: 86rpx;
|
||||
height: 80rpx;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.coupon-listone {
|
||||
margin: 0 30rpx;
|
||||
|
||||
.item {
|
||||
display: flex;
|
||||
background-color: #fff2f0;
|
||||
background-size: 100% 100%;
|
||||
border-radius: 20rpx;
|
||||
align-items: stretch;
|
||||
margin-top: $padding;
|
||||
overflow: hidden;
|
||||
|
||||
&.item-disabled {
|
||||
.item-base {
|
||||
background: #e7e7e7 !important;
|
||||
}
|
||||
}
|
||||
|
||||
.item-base {
|
||||
position: relative;
|
||||
width: 197rpx;
|
||||
min-width: 197rpx;
|
||||
text-align: center;
|
||||
background: linear-gradient(to left, var(--bg-color), var(--bg-color-shallow));
|
||||
background-repeat: no-repeat;
|
||||
background-size: 100% 100%;
|
||||
padding: 38rpx 10rpx 38rpx 18rpx;
|
||||
|
||||
&.disabled {
|
||||
background: #dedede;
|
||||
}
|
||||
|
||||
.coupon-line {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
>view {
|
||||
width: calc(100%);
|
||||
height: auto;
|
||||
position: relative;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
}
|
||||
|
||||
.use_price {
|
||||
font-size: 60rpx;
|
||||
line-height: 1;
|
||||
color: #fff;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.use_condition {
|
||||
color: #fff;
|
||||
margin-top: $padding;
|
||||
|
||||
&.margin_top_none {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&.disabled {
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: #f8f8f8;
|
||||
left: 0;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
height: 30rpx;
|
||||
width: 15rpx;
|
||||
border-radius: 0 30rpx 30rpx 0;
|
||||
}
|
||||
}
|
||||
|
||||
.item-btn {
|
||||
position: relative;
|
||||
width: 160rpx;
|
||||
min-width: 160rpx;
|
||||
align-self: center;
|
||||
|
||||
view {
|
||||
width: 100rpx;
|
||||
height: 50rpx;
|
||||
border-radius: $border-radius;
|
||||
line-height: 50rpx;
|
||||
margin: auto;
|
||||
text-align: center;
|
||||
background-image: linear-gradient(to right, var(--bg-color), var(--bg-color-shallow));
|
||||
color: var(--btn-text-color);
|
||||
;
|
||||
font-size: $font-size-tag;
|
||||
|
||||
&.disabled {
|
||||
background: $color-line !important;
|
||||
color: $color-tip !important;
|
||||
}
|
||||
}
|
||||
|
||||
&::after {
|
||||
position: absolute;
|
||||
content: '';
|
||||
background-color: #f8f8f8;
|
||||
right: 0;
|
||||
top: 50%;
|
||||
transform: translate(0, -50%);
|
||||
height: 30rpx;
|
||||
width: 15rpx;
|
||||
border-radius: 30rpx 0 0 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.item-info {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
margin-left: $padding;
|
||||
overflow: hidden;
|
||||
background-repeat-x: no-repeat;
|
||||
background-repeat-y: repeat;
|
||||
|
||||
.use_time {
|
||||
padding: $padding 0;
|
||||
border-top: 2rpx dashed #cccccc;
|
||||
font-size: $font-size-activity-tag;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
.use_title {
|
||||
font-size: $font-size-base;
|
||||
font-weight: 500;
|
||||
padding: $padding 0;
|
||||
|
||||
.title {
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
.max_price {
|
||||
font-weight: 400;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.truncate {
|
||||
overflow: hidden;
|
||||
-o-text-overflow: ellipsis;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
</style>
|
||||
@@ -1,255 +1,255 @@
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="head-wrap" v-if="storeToken">
|
||||
<text @click="manageFootprint">{{ manage ? '完成' : '管理' }}</text>
|
||||
</view>
|
||||
<mescroll-uni ref="mescroll" @getData="getListData" top="110rpx">
|
||||
<block slot="list">
|
||||
<view class="goods-list single-column" v-if="goodsList.length > 0">
|
||||
<view v-for="(item, index) in goodsList" :key="index">
|
||||
<view class="datetime">{{ datetime(item) }}</view>
|
||||
<view class="goods-item" :class="{ manage: manage }">
|
||||
<view class="checkbox-wrap" v-if="manage" @click="singleElection(item)">
|
||||
<text class="iconfont" :class="$util.inArray(item.id, idArr) != -1 ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></text>
|
||||
</view>
|
||||
<view class="goods-img" @click="toDetail(item)">
|
||||
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)" show-menu-by-longpress ></image>
|
||||
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}</view>
|
||||
</view>
|
||||
<view class="info-wrap" @click="toDetail(item)">
|
||||
<view class="name-wrap">
|
||||
<view class="goods-name">{{ isEnEnv ? item.en_goods_name : item.goods_name }}</view>
|
||||
</view>
|
||||
|
||||
<view class="lineheight-clear">
|
||||
<view class="discount-price">
|
||||
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="price price-style large">{{ parseFloat(showPrice(item)).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="member-price-tag" v-if="item.member_price && item.member_price == showPrice(item)">
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" mode="widthFix" show-menu-by-longpress ></image>
|
||||
</view>
|
||||
<view class="member-price-tag" v-else-if="item.promotion_type == 1">
|
||||
<image :src="$util.img('public/uniapp/index/discount.png')" mode="widthFix" show-menu-by-longpress ></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pro-info">
|
||||
<view class="delete-price font-size-activity-tag color-tip price-font" v-if="showMarketPrice(item)">
|
||||
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text>{{ showMarketPrice(item) }}</text>
|
||||
</view>
|
||||
<view class="sale font-size-activity-tag color-tip" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit ? item.unit : '件' }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footprint-empty" v-else>
|
||||
<ns-empty text="暂无浏览过的商品" subText="赶紧去逛逛, 发现更多商品吧" :isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('toGoodsCategoryPage'), url: '/pages_goods/category' }"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||
@click="toLogin">{{ $lang('toLogin') }}</button>
|
||||
</view>
|
||||
|
||||
<view class="bottom-wrap" v-if="goodsList.length && manage">
|
||||
<view class="all-election" @click="allElection">
|
||||
<view class="iconfont" :class="isAll ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
|
||||
<text>全选</text>
|
||||
</view>
|
||||
<view class="action-btn"><button type="primary" @click="deleteFootprint()" class="delete" :class="{ disabled: selected }">删除</button></view>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var dateList = [];
|
||||
|
||||
import common from './public/js/common.js';
|
||||
|
||||
export default {
|
||||
mixins: [common],
|
||||
data() {
|
||||
return {
|
||||
goodsList: [],
|
||||
current: -1,
|
||||
manage: false,
|
||||
idArr: [],
|
||||
mescroll: null,
|
||||
isSub: false,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.loadingCover.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selected() {
|
||||
return this.idArr.length == 0;
|
||||
},
|
||||
isAll() {
|
||||
return this.idArr.length == this.goodsList.length;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getListData(mescroll) {
|
||||
this.mescroll = mescroll;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsbrowse/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
|
||||
this.goodsList = this.goodsList.concat(newArr); //追加新数据
|
||||
dateList = [];
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
longpress(index) {
|
||||
this.current = index;
|
||||
},
|
||||
deleteFootprint() {
|
||||
if (this.idArr.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请选择要删除的数据!'
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsbrowse/delete',
|
||||
data: {
|
||||
id: this.idArr.toString()
|
||||
},
|
||||
success: res => {
|
||||
this.isSub = false;
|
||||
if (res.code >= 0) {
|
||||
this.idArr = [];
|
||||
this.mescroll.resetUpScroll();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
manageFootprint() {
|
||||
this.manage = !this.manage;
|
||||
dateList = [];
|
||||
},
|
||||
goodsImg(imgStr) {
|
||||
let imgs = imgStr.split(',');
|
||||
return imgs[0]
|
||||
? this.$util.img(imgs[0], {
|
||||
size: 'mid'
|
||||
})
|
||||
: this.$util.getDefaultImage().goods;
|
||||
},
|
||||
imgError(index) {
|
||||
dateList = [];
|
||||
this.goodsList[index].goods_image = this.$util.getDefaultImage().goods;
|
||||
},
|
||||
showPrice(data) {
|
||||
let price = data.discount_price;
|
||||
if (data.member_price && parseFloat(data.member_price) < parseFloat(price)) price = data.member_price;
|
||||
return price;
|
||||
},
|
||||
showMarketPrice(item) {
|
||||
if (item.market_price_show) {
|
||||
let price = this.showPrice(item);
|
||||
if (item.market_price > 0) {
|
||||
return item.market_price;
|
||||
} else if (parseFloat(item.price) > parseFloat(price)) {
|
||||
return item.price;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
goodsTag(data) {
|
||||
return data.label_name || '';
|
||||
},
|
||||
datetime(item) {
|
||||
let date = new Date();
|
||||
date.setTime(item.browse_time * 1000);
|
||||
let y = date.getFullYear();
|
||||
let m = date.getMonth() + 1;
|
||||
m = m < 10 ? '0' + m : m;
|
||||
let d = date.getDate();
|
||||
d = d < 10 ? '0' + d : d;
|
||||
|
||||
var dateTime = y + '/' + m + '/' + d;
|
||||
|
||||
if (this.$util.inArray(dateTime, dateList) == -1) {
|
||||
dateList.push(dateTime);
|
||||
return dateTime;
|
||||
}
|
||||
},
|
||||
singleElection(item) {
|
||||
if (this.$util.inArray(item.id, this.idArr) == -1) {
|
||||
this.idArr.push(item.id);
|
||||
} else {
|
||||
this.idArr.splice(this.$util.inArray(item.id, this.idArr), 1);
|
||||
}
|
||||
dateList = [];
|
||||
},
|
||||
allElection() {
|
||||
if (this.idArr.length != this.goodsList.length) {
|
||||
this.idArr = [];
|
||||
let ids = [];
|
||||
this.goodsList.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
this.idArr = ids;
|
||||
} else {
|
||||
this.idArr = [];
|
||||
}
|
||||
dateList = [];
|
||||
},
|
||||
toDetail(e) {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: e.goods_id
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .empty {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
@import './public/css/footprint.scss';
|
||||
</style>
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<view class="head-wrap" v-if="storeToken">
|
||||
<text @click="manageFootprint">{{ manage ? '完成' : $lang('member.footprint.l4') }}</text>
|
||||
</view>
|
||||
<mescroll-uni ref="mescroll" @getData="getListData" top="110rpx">
|
||||
<block slot="list">
|
||||
<view class="goods-list single-column" v-if="goodsList.length > 0">
|
||||
<view v-for="(item, index) in goodsList" :key="index">
|
||||
<view class="datetime">{{ datetime(item) }}</view>
|
||||
<view class="goods-item" :class="{ manage: manage }">
|
||||
<view class="checkbox-wrap" v-if="manage" @click="singleElection(item)">
|
||||
<text class="iconfont" :class="$util.inArray(item.id, idArr) != -1 ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></text>
|
||||
</view>
|
||||
<view class="goods-img" @click="toDetail(item)">
|
||||
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)" show-menu-by-longpress ></image>
|
||||
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}</view>
|
||||
</view>
|
||||
<view class="info-wrap" @click="toDetail(item)">
|
||||
<view class="name-wrap">
|
||||
<view class="goods-name">{{ isEnEnv ? item.en_goods_name : item.goods_name }}</view>
|
||||
</view>
|
||||
|
||||
<view class="lineheight-clear">
|
||||
<view class="discount-price">
|
||||
<text class="unit price-style small">{{ $lang('common.currency_symbol') }}</text>
|
||||
<text class="price price-style large">{{ parseFloat(showPrice(item)).toFixed(2).split('.')[0] }}</text>
|
||||
<text class="unit price-style small">.{{ parseFloat(showPrice(item)).toFixed(2).split('.')[1] }}</text>
|
||||
</view>
|
||||
<view class="member-price-tag" v-if="item.member_price && item.member_price == showPrice(item)">
|
||||
<image :src="$util.img('public/uniapp/index/VIP.png')" mode="widthFix" show-menu-by-longpress ></image>
|
||||
</view>
|
||||
<view class="member-price-tag" v-else-if="item.promotion_type == 1">
|
||||
<image :src="$util.img('public/uniapp/index/discount.png')" mode="widthFix" show-menu-by-longpress ></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="pro-info">
|
||||
<view class="delete-price font-size-activity-tag color-tip price-font" v-if="showMarketPrice(item)">
|
||||
<text class="unit">{{ $lang('common.currency_symbol') }}</text>
|
||||
<text>{{ showMarketPrice(item) }}</text>
|
||||
</view>
|
||||
<view class="sale font-size-activity-tag color-tip" v-if="item.sale_show">{ $lang("goods.detail.l18") } item.sale_num }}{{ item.unit ? item.unit : $lang('common.ns-goods-sku.ns-goods-sku-index.l150.t0') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="footprint-empty" v-else>
|
||||
<ns-empty text=$lang("member.footprint.l49") subText="赶紧去逛逛, 发现更多商品吧" :isIndex="Boolean(storeToken)" :emptyBtn="{ text: $lang('common.empty.goShopping'), url: '/pages_goods/category' }"></ns-empty>
|
||||
<button type="primary" size="mini" class="button mini" v-if="!storeToken"
|
||||
@click="toLogin">{{ $lang('login.list.to_login') }}</button>
|
||||
</view>
|
||||
|
||||
<view class="bottom-wrap" v-if="goodsList.length && manage">
|
||||
<view class="all-election" @click="allElection">
|
||||
<view class="iconfont" :class="isAll ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
|
||||
<text>{{ $lang("member.footprint.l57") }}</text>
|
||||
</view>
|
||||
<view class="action-btn"><button type="primary" @click="deleteFootprint()" class="delete" :class="{ disabled: selected }">{{ $lang("member.footprint.l59") }}</button></view>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
var dateList = [];
|
||||
|
||||
import common from './public/js/common.js';
|
||||
|
||||
export default {
|
||||
mixins: [common],
|
||||
data() {
|
||||
return {
|
||||
goodsList: [],
|
||||
current: -1,
|
||||
manage: false,
|
||||
idArr: [],
|
||||
mescroll: null,
|
||||
isSub: false,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.loadingCover.hide();
|
||||
});
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
selected() {
|
||||
return this.idArr.length == 0;
|
||||
},
|
||||
isAll() {
|
||||
return this.idArr.length == this.goodsList.length;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getListData(mescroll) {
|
||||
this.mescroll = mescroll;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsbrowse/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
|
||||
this.goodsList = this.goodsList.concat(newArr); //追加新数据
|
||||
dateList = [];
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
longpress(index) {
|
||||
this.current = index;
|
||||
},
|
||||
deleteFootprint() {
|
||||
if (this.idArr.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.footprint.l137')
|
||||
});
|
||||
return;
|
||||
}
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsbrowse/delete',
|
||||
data: {
|
||||
id: this.idArr.toString()
|
||||
},
|
||||
success: res => {
|
||||
this.isSub = false;
|
||||
if (res.code >= 0) {
|
||||
this.idArr = [];
|
||||
this.mescroll.resetUpScroll();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
manageFootprint() {
|
||||
this.manage = !this.manage;
|
||||
dateList = [];
|
||||
},
|
||||
goodsImg(imgStr) {
|
||||
let imgs = imgStr.split(',');
|
||||
return imgs[0]
|
||||
? this.$util.img(imgs[0], {
|
||||
size: 'mid'
|
||||
})
|
||||
: this.$util.getDefaultImage().goods;
|
||||
},
|
||||
imgError(index) {
|
||||
dateList = [];
|
||||
this.goodsList[index].goods_image = this.$util.getDefaultImage().goods;
|
||||
},
|
||||
showPrice(data) {
|
||||
let price = data.discount_price;
|
||||
if (data.member_price && parseFloat(data.member_price) < parseFloat(price)) price = data.member_price;
|
||||
return price;
|
||||
},
|
||||
showMarketPrice(item) {
|
||||
if (item.market_price_show) {
|
||||
let price = this.showPrice(item);
|
||||
if (item.market_price > 0) {
|
||||
return item.market_price;
|
||||
} else if (parseFloat(item.price) > parseFloat(price)) {
|
||||
return item.price;
|
||||
}
|
||||
}
|
||||
return '';
|
||||
},
|
||||
goodsTag(data) {
|
||||
return data.label_name || '';
|
||||
},
|
||||
datetime(item) {
|
||||
let date = new Date();
|
||||
date.setTime(item.browse_time * 1000);
|
||||
let y = date.getFullYear();
|
||||
let m = date.getMonth() + 1;
|
||||
m = m < 10 ? '0' + m : m;
|
||||
let d = date.getDate();
|
||||
d = d < 10 ? '0' + d : d;
|
||||
|
||||
var dateTime = y + '/' + m + '/' + d;
|
||||
|
||||
if (this.$util.inArray(dateTime, dateList) == -1) {
|
||||
dateList.push(dateTime);
|
||||
return dateTime;
|
||||
}
|
||||
},
|
||||
singleElection(item) {
|
||||
if (this.$util.inArray(item.id, this.idArr) == -1) {
|
||||
this.idArr.push(item.id);
|
||||
} else {
|
||||
this.idArr.splice(this.$util.inArray(item.id, this.idArr), 1);
|
||||
}
|
||||
dateList = [];
|
||||
},
|
||||
allElection() {
|
||||
if (this.idArr.length != this.goodsList.length) {
|
||||
this.idArr = [];
|
||||
let ids = [];
|
||||
this.goodsList.forEach(item => {
|
||||
ids.push(item.id);
|
||||
});
|
||||
this.idArr = ids;
|
||||
} else {
|
||||
this.idArr = [];
|
||||
}
|
||||
dateList = [];
|
||||
},
|
||||
toDetail(e) {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: e.goods_id
|
||||
});
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .empty {
|
||||
margin-top: 0 !important;
|
||||
}
|
||||
|
||||
@import './public/css/footprint.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,202 +1,202 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view :style="pageStyle"
|
||||
class="page-img">
|
||||
<view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch"
|
||||
:style="{ backgroundImage: bgImg }">
|
||||
<ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="!isTabRootPage" />
|
||||
</view>
|
||||
|
||||
<diy-index-page v-if="topIndexValue" ref="indexPage" :value="topIndexValue" :bgUrl="bgUrl"
|
||||
:scrollTop="scrollTop" :diyGlobal="diyData.global" class="diy-index-page">
|
||||
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop"
|
||||
:haveTopCategory="true" />
|
||||
<ns-copyright v-show="isShowCopyRight" />
|
||||
</diy-index-page>
|
||||
|
||||
<view v-else class="bg-index"
|
||||
:style="{ backgroundImage: backgroundUrl, paddingTop: paddingTop, marginTop: marginTop }">
|
||||
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop" />
|
||||
<ns-copyright v-show="isShowCopyRight" />
|
||||
|
||||
<view class="foot">
|
||||
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=0')">{{
|
||||
$lang('privacyPolicy') }}</view>
|
||||
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=1')">{{
|
||||
$lang('registrationAgreement') }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 退出登录和账号注销按钮 -->
|
||||
<view class="action-buttons" v-if="storeToken">
|
||||
<view class="action-btn cancel-btn" v-if="isShowCancelButton"
|
||||
@click="cancellation">{{ $lang('cancellation') }}</view>
|
||||
<view class="action-btn logout-btn" v-if="isShowLogoutButton"
|
||||
@click="logout">{{ $lang('logout') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<template
|
||||
v-if="diyData.global && diyData.global.popWindow && diyData.global.popWindow.count != -1 && diyData.global.popWindow.imageUrl">
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="uniPopupWindow" type="center" class="wap-floating" :maskClick="false">
|
||||
<view class="image-wrap">
|
||||
<image :src="$util.img(diyData.global.popWindow.imageUrl)" :style="popWindowStyle"
|
||||
@click="uniPopupWindowFn()" mode="aspectFit" show-menu-by-longpress/>
|
||||
</view>
|
||||
<text class="iconfont icon-round-close" @click="closePopupWindow"></text>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar" :class="{ hide: bottomNavHidden }" v-if="openBottomNav">
|
||||
<diy-bottom-nav @callback="callback" />
|
||||
</view>
|
||||
|
||||
<!-- 收藏 -->
|
||||
<uni-popup ref="collectPopupWindow" type="top" class="wap-floating wap-floating-collect">
|
||||
<view v-if="showTip" class="collectPopupWindow"
|
||||
:style="{ marginTop: (collectTop + statusBarHeight) * 2 + 'rpx' }">
|
||||
<image :src="$util.img('public/uniapp/index/collect2.png')" mode="aspectFit" show-menu-by-longpress/>
|
||||
<text @click="closeCollectPopupWindow">我知道了</text>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<ns-birthday-gift ref="birthdayGift"></ns-birthday-gift>
|
||||
<ns-new-gift ref="nsNewGift"></ns-new-gift>
|
||||
|
||||
|
||||
<hover-nav></hover-nav>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import diyJs from '@/common/js/diy.js';
|
||||
import indexJs from './public/js/index.js';
|
||||
import memberPublic from './public/js/member-public.js';
|
||||
|
||||
import nsBirthdayGift from '../_components/ns-birthday-gift/ns-birthday-gift.vue';
|
||||
import nsNewGift from '../_components/ns-new-gift/ns-new-gift.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsBirthdayGift,
|
||||
nsNewGift
|
||||
},
|
||||
mixins: [diyJs, indexJs, memberPublic],
|
||||
computed: {
|
||||
pageStyle() {
|
||||
return {
|
||||
backgroundColor: this.bgColor,
|
||||
minHeight: this.openBottomNav ? 'calc(100vh - 55px)' : ''
|
||||
};
|
||||
},
|
||||
isShowCancelButton() {
|
||||
return this.diyData?.global?.isShowCancelButton?.[`${this.getAppType()}`] !== 0
|
||||
},
|
||||
isShowLogoutButton() {
|
||||
return this.diyData?.global?.isShowLogoutButton?.[`${this.getAppType()}`] !== 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$util.hideHomeButton();
|
||||
},
|
||||
onShow() {
|
||||
this.$util.hideHomeButton();
|
||||
},
|
||||
methods: {
|
||||
|
||||
tourl(url) {
|
||||
this.$util.redirectTo(url);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/common/css/diy.scss';
|
||||
|
||||
.foot {
|
||||
display: flex;
|
||||
// position: absolute;
|
||||
width: 100%;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.item {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
// P0: 硬编码主色 → var(--main-color)
|
||||
// 兼容: 微信小程序 / 鸿蒙元服务 — color 接受 var() 无问题
|
||||
color: var(--main-color, #F4391c);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.wap-floating>>>.uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
::v-deep .diy-index-page .uni-popup .uni-popup__wrapper-box {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.choose-store>>>.goodslist-uni-popup-box {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
::v-deep .placeholder {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
::v-deep ::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
background-color: transparent;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 20rpx 30rpx 40rpx;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
width: 80%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
border-radius: 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
background-color: var(--main-color);
|
||||
color: #fff;
|
||||
border: 1rpx solid #ddd;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
background-color:var(--main-color);
|
||||
color: #fff;
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view :style="pageStyle"
|
||||
class="page-img">
|
||||
<view class="page-header" v-if="diyData.global && diyData.global.navBarSwitch"
|
||||
:style="{ backgroundImage: bgImg }">
|
||||
<ns-navbar :title-color="textNavColor" :data="diyData.global" :scrollTop="scrollTop" :isBack="!isTabRootPage" />
|
||||
</view>
|
||||
|
||||
<diy-index-page v-if="topIndexValue" ref="indexPage" :value="topIndexValue" :bgUrl="bgUrl"
|
||||
:scrollTop="scrollTop" :diyGlobal="diyData.global" class="diy-index-page">
|
||||
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop"
|
||||
:haveTopCategory="true" />
|
||||
<ns-copyright v-show="isShowCopyRight" />
|
||||
</diy-index-page>
|
||||
|
||||
<view v-else class="bg-index"
|
||||
:style="{ backgroundImage: backgroundUrl, paddingTop: paddingTop, marginTop: marginTop }">
|
||||
<diy-group ref="diyGroup" v-if="diyData.value" :diyData="diyData" :scrollTop="scrollTop" />
|
||||
<ns-copyright v-show="isShowCopyRight" />
|
||||
|
||||
<view class="foot">
|
||||
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=0')">{{
|
||||
$lang('login.list.privacy_policy') }}</view>
|
||||
<view class="item" @click="tourl('/pages_tool/agreement/contenr?type=1')">{{
|
||||
$lang('login.list.registration_agreement') }}</view>
|
||||
</view>
|
||||
|
||||
<!-- 退出登录和账号注销按钮 -->
|
||||
<view class="action-buttons" v-if="storeToken">
|
||||
<view class="action-btn cancel-btn" v-if="isShowCancelButton"
|
||||
@click="cancellation">{{ $lang('member.list.cancellation') }}</view>
|
||||
<view class="action-btn logout-btn" v-if="isShowLogoutButton"
|
||||
@click="logout">{{ $lang('login.button.logout') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<template
|
||||
v-if="diyData.global && diyData.global.popWindow && diyData.global.popWindow.count != -1 && diyData.global.popWindow.imageUrl">
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="uniPopupWindow" type="center" class="wap-floating" :maskClick="false">
|
||||
<view class="image-wrap">
|
||||
<image :src="$util.img(diyData.global.popWindow.imageUrl)" :style="popWindowStyle"
|
||||
@click="uniPopupWindowFn()" mode="aspectFit" show-menu-by-longpress/>
|
||||
</view>
|
||||
<text class="iconfont icon-round-close" @click="closePopupWindow"></text>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar" :class="{ hide: bottomNavHidden }" v-if="openBottomNav">
|
||||
<diy-bottom-nav @callback="callback" />
|
||||
</view>
|
||||
|
||||
<!-- 收藏 -->
|
||||
<uni-popup ref="collectPopupWindow" type="top" class="wap-floating wap-floating-collect">
|
||||
<view v-if="showTip" class="collectPopupWindow"
|
||||
:style="{ marginTop: (collectTop + statusBarHeight) * 2 + 'rpx' }">
|
||||
<image :src="$util.img('public/uniapp/index/collect2.png')" mode="aspectFit" show-menu-by-longpress/>
|
||||
<text @click="closeCollectPopupWindow">{{ $lang("diy.diy-notice.l49.t0") }}</text>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<ns-birthday-gift ref="birthdayGift"></ns-birthday-gift>
|
||||
<ns-new-gift ref="nsNewGift"></ns-new-gift>
|
||||
|
||||
|
||||
<hover-nav></hover-nav>
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<!-- 小程序隐私协议 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import diyJs from '@/common/js/diy.js';
|
||||
import indexJs from './public/js/index.js';
|
||||
import memberPublic from './public/js/member-public.js';
|
||||
|
||||
import nsBirthdayGift from '../_components/ns-birthday-gift/ns-birthday-gift.vue';
|
||||
import nsNewGift from '../_components/ns-new-gift/ns-new-gift.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
nsBirthdayGift,
|
||||
nsNewGift
|
||||
},
|
||||
mixins: [diyJs, indexJs, memberPublic],
|
||||
computed: {
|
||||
pageStyle() {
|
||||
return {
|
||||
backgroundColor: this.bgColor,
|
||||
minHeight: this.openBottomNav ? 'calc(100vh - 55px)' : ''
|
||||
};
|
||||
},
|
||||
isShowCancelButton() {
|
||||
return this.diyData?.global?.isShowCancelButton?.[`${this.getAppType()}`] !== 0
|
||||
},
|
||||
isShowLogoutButton() {
|
||||
return this.diyData?.global?.isShowLogoutButton?.[`${this.getAppType()}`] !== 0
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.$util.hideHomeButton();
|
||||
},
|
||||
onShow() {
|
||||
this.$util.hideHomeButton();
|
||||
},
|
||||
methods: {
|
||||
|
||||
tourl(url) {
|
||||
this.$util.redirectTo(url);
|
||||
}
|
||||
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import '@/common/css/diy.scss';
|
||||
|
||||
.foot {
|
||||
display: flex;
|
||||
// position: absolute;
|
||||
width: 100%;
|
||||
margin-bottom: 40rpx;
|
||||
|
||||
.item {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
// P0: 硬编码主色 → var(--main-color)
|
||||
// 兼容: 微信小程序 / 鸿蒙元服务 — color 接受 var() 无问题
|
||||
color: var(--main-color, #F4391c);
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.wap-floating>>>.uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
::v-deep .diy-index-page .uni-popup .uni-popup__wrapper-box {
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.choose-store>>>.goodslist-uni-popup-box {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
::v-deep .placeholder {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
::v-deep ::-webkit-scrollbar {
|
||||
width: 0;
|
||||
height: 0;
|
||||
background-color: transparent;
|
||||
display: none;
|
||||
}
|
||||
|
||||
.hide {
|
||||
display: none;
|
||||
}
|
||||
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
|
||||
.action-buttons {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
margin: 20rpx 30rpx 40rpx;
|
||||
gap: 20rpx;
|
||||
}
|
||||
|
||||
.action-btn {
|
||||
width: 80%;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
border-radius: 40rpx;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.logout-btn {
|
||||
background-color: var(--main-color);
|
||||
color: #fff;
|
||||
border: 1rpx solid #ddd;
|
||||
}
|
||||
|
||||
.cancel-btn {
|
||||
background-color:var(--main-color);
|
||||
color: #fff;
|
||||
}
|
||||
</style>
|
||||
@@ -1,329 +1,329 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view v-if="indent == 'all' && memberInfo" class="info-wrap">
|
||||
<!-- 头像@click="headImage" -->
|
||||
<view class="info-list-cell info-item info-list-con" hover-class="cell-hover">
|
||||
<text class="cell-tit">头像</text>
|
||||
<view class="info-list-head cell-tip">
|
||||
<image :src="memberInfo.headimg ? $util.img(memberInfo.headimg) : $util.getDefaultImage().head" @error="memberInfo.headimg = $util.getDefaultImage().head" mode="aspectFill" show-menu-by-longpress/>
|
||||
</view>
|
||||
<text style="margin-right: 20rpx;"></text>
|
||||
</view>
|
||||
<!-- 账号 -->
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" v-if="memberInfo.is_edit_username == 1" @click="modifyInfo('username')">
|
||||
<text class="cell-tit">账号</text>
|
||||
<text class="cell-tip">{{ memberInfoformData.number }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
<!-- 账号 -->
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" v-else>
|
||||
<text class="cell-tit">{{ $lang('account') }}</text>
|
||||
<text class="cell-tip cell-tip1">{{ memberInfoformData.number }}</text>
|
||||
</view> -->
|
||||
<!-- 昵称 -->
|
||||
<view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('name')">
|
||||
<text class="cell-tit">昵称</text>
|
||||
<text class="cell-tip">{{ memberInfoformData.nickName }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- 真实姓名 -->
|
||||
<view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('realName')">
|
||||
<text class="cell-tit">姓名</text>
|
||||
<text class="cell-tip">{{ memberInfoformData.realName }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- 性别 -->
|
||||
<view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('sex')">
|
||||
<text class="cell-tit">性别</text>
|
||||
<text class="cell-tip">{{ memberInfoformData.sex }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- 生日 -->
|
||||
<view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('birthday')">
|
||||
<text class="cell-tit">生日</text>
|
||||
<text class="cell-tip">{{ memberInfoformData.birthday }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- 手机号 -->
|
||||
<view class="info-list-cell info-list-con" @click="modifyInfo('mobile')">
|
||||
<text class="cell-tit">手机号</text>
|
||||
<text v-if="memberInfoformData.user_tel == ''" class="cell-tip">密码</text>
|
||||
<text v-else class="cell-tip">{{ memberInfoformData.mobile }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- 密码 -->
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('password')">
|
||||
<text class="cell-tit">密码</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
<!-- 支付密码 -->
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('paypassword')">
|
||||
<text class="cell-tit">{{ $lang('paypassword') }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('address')">
|
||||
<text class="cell-tit">所在地址</text>
|
||||
<text class="cell-tip" v-if="memberInfo.full_address">{{ memberInfo.full_address }}
|
||||
{{ memberInfo.address }}</text>
|
||||
<text class="cell-tip" v-else>去设置</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
|
||||
<!-- 注销 -->
|
||||
<view class="info-list-cell info-list-con" hover-class="cell-hover" @click="cancellation()">
|
||||
<text class="cell-tit">注销账号</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" @click="cancellation()" v-if="addonIsExist.membercancel && memberConfig.is_enable == 1">
|
||||
<text class="cell-tit">注销账号</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover">
|
||||
<text class="cell-tit">版本号</text>
|
||||
<text class="cell-tip cell-tip1">{{ version }}</text>
|
||||
</view> -->
|
||||
|
||||
<!-- 语言 -->
|
||||
<!-- <view class="info-list-cell info-item info-list-con" hover-class="cell-hover" @click="modifyInfo('language')">
|
||||
<text class="cell-tit">{{ $lang('lang') }}</text>
|
||||
<text class="cell-tip">{{ langList[langIndex].name }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
<!-- 退出登录 -->
|
||||
<!-- <view class="info-list-cell log-out-btn" >
|
||||
<text class="cell-tit color-base-text"></text>
|
||||
</view> -->
|
||||
<!-- #ifdef H5 -->
|
||||
|
||||
<!-- #endif -->
|
||||
<view class="save-item" @click="logout">
|
||||
<button type="primary">退出登录</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import info from './public/js/info.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
version: ''
|
||||
};
|
||||
},
|
||||
mixins: [info],
|
||||
onLoad(data) {
|
||||
this.version = this.$config.version;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.info-head {
|
||||
.head-nav {
|
||||
width: 100%;
|
||||
height: var(--status-bar-height);
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.head-nav.active {
|
||||
padding-top: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.captcha {
|
||||
width: 170rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.info-list-cell {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 24rpx 30rpx;
|
||||
position: relative;
|
||||
line-height: 50rpx;
|
||||
background-color: #fff;
|
||||
|
||||
&:first-child {
|
||||
padding: 28rpx 30rpx;
|
||||
}
|
||||
|
||||
.cell-tit {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.cell-tip1 {
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
&.log-out-btn {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.cell-tit {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.info-list-head {
|
||||
border: 1rpx solid $color-line;
|
||||
width: 82rpx;
|
||||
height: 82rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.info-list-head image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
// #ifdef MP
|
||||
&.info-item {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
// #endif
|
||||
|
||||
&.info-list-con~&.info-list-con:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
top: 0;
|
||||
border-bottom: 1rpx solid $color-line;
|
||||
}
|
||||
|
||||
.cell-tip {
|
||||
margin-left: auto;
|
||||
color: $color-tip;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 470rpx;
|
||||
}
|
||||
|
||||
.cell-more {
|
||||
margin-left: 10rpx;
|
||||
width: 32rpx;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.cell-more:after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
|
||||
border: 2rpx solid darken($color-line, 20%) {
|
||||
right-color: transparent;
|
||||
bottom-color: transparent;
|
||||
}
|
||||
|
||||
transform: rotate(135deg);
|
||||
}
|
||||
}
|
||||
|
||||
.edit-info-box {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 40rpx;
|
||||
min-height: 50rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.info-name {
|
||||
width: 150rpx;
|
||||
font-size: $font-size-base;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
width: 0;
|
||||
font-size: $font-size-base;
|
||||
padding: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.dynacode {
|
||||
margin: 0;
|
||||
padding: 0 10rpx;
|
||||
width: 250rpx;
|
||||
height: 60rpx;
|
||||
font-size: $font-size-base;
|
||||
line-height: 60rpx;
|
||||
color: #fff;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.edit-sex-list {
|
||||
display: flex;
|
||||
|
||||
label {
|
||||
display: flex;
|
||||
margin-left: 30rpx;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
uni-radio .uni-radio-input {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.set-pass-tips {
|
||||
padding: 20rpx 20rpx 0 20rpx;
|
||||
}
|
||||
|
||||
.input-len {
|
||||
width: 500rpx !important;
|
||||
}
|
||||
|
||||
.save-item {
|
||||
margin: 50rpx auto;
|
||||
|
||||
button {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
justify-content: center;
|
||||
padding-top: 80rpx;
|
||||
|
||||
.empty_img {
|
||||
width: 63%;
|
||||
height: 450rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 190rpx;
|
||||
color: $color-tip;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
button {
|
||||
min-width: 300rpx;
|
||||
margin-top: 100rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view v-if="indent == 'all' && memberInfo" class="info-wrap">
|
||||
<!-- 头像@click="headImage" -->
|
||||
<view class="info-list-cell info-item info-list-con" hover-class="cell-hover">
|
||||
<text class="cell-tit">{{ $lang("common.ns-login.l79.t0") }}</text>
|
||||
<view class="info-list-head cell-tip">
|
||||
<image :src="memberInfo.headimg ? $util.img(memberInfo.headimg) : $util.getDefaultImage().head" @error="memberInfo.headimg = $util.getDefaultImage().head" mode="aspectFill" show-menu-by-longpress/>
|
||||
</view>
|
||||
<text style="margin-right: 20rpx;"></text>
|
||||
</view>
|
||||
<!-- 账号 -->
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" v-if="memberInfo.is_edit_username == 1" @click="modifyInfo('username')">
|
||||
<text class="cell-tit">{{ $lang("member.info.l14") }}</text>
|
||||
<text class="cell-tip">{{ memberInfoformData.number }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
<!-- 账号 -->
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" v-else>
|
||||
<text class="cell-tit">{{ $lang('member.list.account') }}</text>
|
||||
<text class="cell-tip cell-tip1">{{ memberInfoformData.number }}</text>
|
||||
</view> -->
|
||||
<!-- 昵称 -->
|
||||
<view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('name')">
|
||||
<text class="cell-tit">{{ $lang("common.ns-login.l87.t0") }}</text>
|
||||
<text class="cell-tip">{{ memberInfoformData.nickName }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- 真实姓名 -->
|
||||
<view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('realName')">
|
||||
<text class="cell-tit">{{ $lang("order._components.common-payment.l138.t0") }}</text>
|
||||
<text class="cell-tip">{{ memberInfoformData.realName }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- 性别 -->
|
||||
<view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('sex')">
|
||||
<text class="cell-tit">{{ $lang("member.info.l37") }}</text>
|
||||
<text class="cell-tip">{{ memberInfoformData.sex }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- 生日 -->
|
||||
<view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('birthday')">
|
||||
<text class="cell-tit">{{ $lang("member.info.l43") }}</text>
|
||||
<text class="cell-tip">{{ memberInfoformData.birthday }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- 手机号 -->
|
||||
<view class="info-list-cell info-list-con" @click="modifyInfo('mobile')">
|
||||
<text class="cell-tit">{{ $lang("common.ns-login.l15.t0") }}</text>
|
||||
<text v-if="memberInfoformData.user_tel == ''" class="cell-tip">{{ $lang("member.info.l50") }}</text>
|
||||
<text v-else class="cell-tip">{{ memberInfoformData.mobile }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- 密码 -->
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('password')">
|
||||
<text class="cell-tit">{{ $lang("member.info.l50") }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
<!-- 支付密码 -->
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('paypassword')">
|
||||
<text class="cell-tit">{{ $lang('pay.list.paypassword') }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" @click="modifyInfo('address')">
|
||||
<text class="cell-tit">{{ $lang("member.info.l66") }}</text>
|
||||
<text class="cell-tip" v-if="memberInfo.full_address">{{ memberInfo.full_address }}
|
||||
{{ memberInfo.address }}</text>
|
||||
<text class="cell-tip" v-else>{{ $lang("point.public.js.payment.l285") }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
|
||||
<!-- 注销 -->
|
||||
<view class="info-list-cell info-list-con" hover-class="cell-hover" @click="cancellation()">
|
||||
<text class="cell-tit">{{ $lang("member.info.l75") }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view>
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover" @click="cancellation()" v-if="addonIsExist.membercancel && memberConfig.is_enable == 1">
|
||||
<text class="cell-tit">{{ $lang("member.info.l75") }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
<!-- <view class="info-list-cell info-list-con" hover-class="cell-hover">
|
||||
<text class="cell-tit">{{ $lang("member.info.l83") }}</text>
|
||||
<text class="cell-tip cell-tip1">{{ version }}</text>
|
||||
</view> -->
|
||||
|
||||
<!-- 语言 -->
|
||||
<!-- <view class="info-list-cell info-item info-list-con" hover-class="cell-hover" @click="modifyInfo('language')">
|
||||
<text class="cell-tit">{{ $lang('common.list.lang') }}</text>
|
||||
<text class="cell-tip">{{ langList[langIndex].name }}</text>
|
||||
<text class="cell-more"></text>
|
||||
</view> -->
|
||||
<!-- 退出登录 -->
|
||||
<!-- <view class="info-list-cell log-out-btn" >
|
||||
<text class="cell-tit color-base-text"></text>
|
||||
</view> -->
|
||||
<!-- #ifdef H5 -->
|
||||
|
||||
<!-- #endif -->
|
||||
<view class="save-item" @click="logout">
|
||||
<button type="primary">{{ $lang("member.info.l101") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import info from './public/js/info.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
version: ''
|
||||
};
|
||||
},
|
||||
mixins: [info],
|
||||
onLoad(data) {
|
||||
this.version = this.$config.version;
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.info-head {
|
||||
.head-nav {
|
||||
width: 100%;
|
||||
height: var(--status-bar-height);
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.head-nav.active {
|
||||
padding-top: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.captcha {
|
||||
width: 170rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.info-list-cell {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 24rpx 30rpx;
|
||||
position: relative;
|
||||
line-height: 50rpx;
|
||||
background-color: #fff;
|
||||
|
||||
&:first-child {
|
||||
padding: 28rpx 30rpx;
|
||||
}
|
||||
|
||||
.cell-tit {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.cell-tip1 {
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
&.log-out-btn {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.cell-tit {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.info-list-head {
|
||||
border: 1rpx solid $color-line;
|
||||
width: 82rpx;
|
||||
height: 82rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.info-list-head image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
// #ifdef MP
|
||||
&.info-item {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
|
||||
// #endif
|
||||
|
||||
&.info-list-con~&.info-list-con:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
top: 0;
|
||||
border-bottom: 1rpx solid $color-line;
|
||||
}
|
||||
|
||||
.cell-tip {
|
||||
margin-left: auto;
|
||||
color: $color-tip;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 470rpx;
|
||||
}
|
||||
|
||||
.cell-more {
|
||||
margin-left: 10rpx;
|
||||
width: 32rpx;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.cell-more:after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
|
||||
border: 2rpx solid darken($color-line, 20%) {
|
||||
right-color: transparent;
|
||||
bottom-color: transparent;
|
||||
}
|
||||
|
||||
transform: rotate(135deg);
|
||||
}
|
||||
}
|
||||
|
||||
.edit-info-box {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 40rpx;
|
||||
min-height: 50rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.info-name {
|
||||
width: 150rpx;
|
||||
font-size: $font-size-base;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
width: 0;
|
||||
font-size: $font-size-base;
|
||||
padding: 0;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.dynacode {
|
||||
margin: 0;
|
||||
padding: 0 10rpx;
|
||||
width: 250rpx;
|
||||
height: 60rpx;
|
||||
font-size: $font-size-base;
|
||||
line-height: 60rpx;
|
||||
color: #fff;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.edit-sex-list {
|
||||
display: flex;
|
||||
|
||||
label {
|
||||
display: flex;
|
||||
margin-left: 30rpx;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
uni-radio .uni-radio-input {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.set-pass-tips {
|
||||
padding: 20rpx 20rpx 0 20rpx;
|
||||
}
|
||||
|
||||
.input-len {
|
||||
width: 500rpx !important;
|
||||
}
|
||||
|
||||
.save-item {
|
||||
margin: 50rpx auto;
|
||||
|
||||
button {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
justify-content: center;
|
||||
padding-top: 80rpx;
|
||||
|
||||
.empty_img {
|
||||
width: 63%;
|
||||
height: 450rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 190rpx;
|
||||
color: $color-tip;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
button {
|
||||
min-width: 300rpx;
|
||||
margin-top: 100rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,387 +1,387 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<template v-if="memberInfo">
|
||||
<!-- 修改用户名 -->
|
||||
<view v-if="indent == 'username'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">用户名</text>
|
||||
<input class="uni-input info-content input-len" type="text" maxlength="30" placeholder="请输入" v-model="formData.username" />
|
||||
</view>
|
||||
<view class="color-tip font-size-goods-tag set-pass-tips">用户名仅可修改一次,请谨慎设置</view>
|
||||
<view class="save-item" @click="save('username')">
|
||||
<button type="primary">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改昵称 -->
|
||||
<view v-if="indent == 'name'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">昵称</text>
|
||||
<input class="uni-input info-content input-len" type="text" maxlength="30" placeholder="请输入" v-model="formData.nickName" />
|
||||
</view>
|
||||
<view class="save-item" @click="save('name')">
|
||||
<button type="primary">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改真实姓名 -->
|
||||
<view v-if="indent == 'realName'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">姓名</text>
|
||||
<input class="uni-input info-content input-len" type="text" maxlength="30" placeholder="请输入" v-model="formData.realName" />
|
||||
</view>
|
||||
<view class="save-item" @click="save('realName')">
|
||||
<button type="primary">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改性别 -->
|
||||
<view v-if="indent == 'sex'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">性别</text>
|
||||
<radio-group @change="radioChange" class="edit-sex-list">
|
||||
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items" :key="item.value">
|
||||
<view>
|
||||
<radio :color="themeStyle.main_color" :value="item.value" :checked="index === formData.sex" />
|
||||
</view>
|
||||
<view>{{ item.name }}</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
<view class="save-item" @click="save('sex')">
|
||||
<button type="primary">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改生日 -->
|
||||
<view v-if="indent == 'birthday'" class="edit-info edit-birthday-list">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">生日</text>
|
||||
<picker mode="date" :value="formData.birthday" :start="startDate" :end="endDate" @change="bindDateChange">
|
||||
<view class="uni-input">{{ formData.birthday ? formData.birthday : '请选择生日' }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="save-item" @click="save('birthday')">
|
||||
<button type="primary">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改密码 -->
|
||||
<view v-if="indent == 'password'" class="edit-info">
|
||||
<block v-if="memberInfo.password == 0 && memberInfo.mobile == ''">
|
||||
<view class="empty">
|
||||
<view class="empty_img">
|
||||
<image :src="$util.img('public/uniapp/common/common-empty.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="color-tip margin-top margin-bottom">请先绑定手机再执行该操作</view>
|
||||
<button type="primary" size="mini" class="mini button color-base-bg" @click="modifyInfo('mobile')">立即绑定</button>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="edit-info-box" v-if="memberInfo.password">
|
||||
<text class="info-name">原密码</text>
|
||||
<input class="uni-input info-content input-len" type="password" maxlength="30" placeholder="请输入" v-model="formData.currentPassword" />
|
||||
</view>
|
||||
<block v-else>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">新密码</text>
|
||||
<input class="uni-input info-content" type="number" maxlength="4" placeholder="请输入" v-model="formData.mobileVercode" />
|
||||
<image :src="captcha.img" class="captcha" @click="getCaptcha" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">再次输入</text>
|
||||
<input class="uni-input info-content" type="number" maxlength="6" placeholder="请输入" v-model="formData.mobileDynacode" />
|
||||
<button type="primary" class="dynacode" @click="passwordMoblieCode()">{{ formData.mobileCodeText }}</button>
|
||||
</view>
|
||||
<view class="color-tip font-size-goods-tag set-pass-tips">
|
||||
点击“获取动态码”,将会向您已绑定的手机号{{ memberInfoformData.mobile | mobile }}发送验证码</view>
|
||||
</block>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">新密码</text>
|
||||
<input class="uni-input info-content input-len" type="password" maxlength="30" placeholder="请输入" v-model="formData.newPassword" />
|
||||
</view>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">再次输入</text>
|
||||
<input class="uni-input info-content input-len" type="password" maxlength="30" placeholder="请输入" v-model="formData.confirmPassword" />
|
||||
</view>
|
||||
|
||||
<view class="save-item" @click="save('password')">
|
||||
<button type="primary">保存</button>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 修改手机号 -->
|
||||
<view v-if="indent == 'mobile'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">手机号</text>
|
||||
<input class="uni-input info-content" type="number" maxlength="11" placeholder="请输入" v-model="formData.mobile" />
|
||||
</view>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">验证码</text>
|
||||
<input class="uni-input info-content" type="number" maxlength="4" placeholder="请输入" v-model="formData.mobileVercode" />
|
||||
<image :src="captcha.img" class="captcha" @click="getCaptcha" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">短信验证码</text>
|
||||
<input class="uni-input info-content" type="number" maxlength="6" placeholder="请输入" v-model="formData.mobileDynacode" />
|
||||
<button type="primary" class="dynacode" @click="bindMoblieCode()">{{ formData.mobileCodeText }}</button>
|
||||
</view>
|
||||
<view class="save-item" @click="save('mobile')">
|
||||
<button type="primary">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 绑定手机号 -->
|
||||
<view v-if="indent == 'bind_mobile'" class="edit-info">
|
||||
<view class="save-item bind-mobile">
|
||||
<button type="primary" open-type="getPhoneNumber" @getphonenumber="mobileAuth">一键授权绑定</button>
|
||||
</view>
|
||||
<view class="save-item bind-mobile">
|
||||
<button type="primary" @click="manualBinding">手动绑定</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="indent == 'address'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">所在地区</text>
|
||||
<pick-regions :default-regions="defaultRegions" select-arr="3" @getRegions="handleGetRegions">
|
||||
<text class="select-address " :class="{'color-tip': !formData.fullAddress }">
|
||||
{{ formData.fullAddress ? formData.fullAddress : '请选择省市区县' }}
|
||||
</text>
|
||||
</pick-regions>
|
||||
</view>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">详细地址</text>
|
||||
<input class="uni-input info-content" type="text" placeholder="详细地址" v-model="formData.address" />
|
||||
</view>
|
||||
<view class="save-item" @click="save('address')">
|
||||
<button type="primary">保存</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import info from './public/js/info.js';
|
||||
import auth from '@/common/js/auth.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onLoad(data) {
|
||||
if (data.type) this.indent = data.type;
|
||||
},
|
||||
mixins: [info, auth],
|
||||
filters: {
|
||||
mobile(mobile) {
|
||||
return mobile.substring(0, 4 - 1) + '****' + mobile.substring(6 + 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.info-head {
|
||||
.head-nav {
|
||||
width: 100%;
|
||||
height: var(--status-bar-height);
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.head-nav.active {
|
||||
padding-top: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.captcha {
|
||||
width: 170rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.info-list-cell {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 24rpx 30rpx;
|
||||
position: relative;
|
||||
line-height: 50rpx;
|
||||
background-color: #fff;
|
||||
|
||||
&:first-child {
|
||||
padding: 28rpx 30rpx;
|
||||
}
|
||||
|
||||
.cell-tip1 {
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
&.log-out-btn {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.cell-tit {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.info-list-head {
|
||||
border: 1rpx solid $color-line;
|
||||
width: 82rpx;
|
||||
height: 82rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.info-list-head image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
// #ifdef MP
|
||||
&.info-item {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
// #endif
|
||||
|
||||
&.info-list-con~&.info-list-con:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
top: 0;
|
||||
border-bottom: 1rpx solid $color-line;
|
||||
}
|
||||
|
||||
.cell-tip {
|
||||
margin-left: auto;
|
||||
color: $color-tip;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 470rpx;
|
||||
}
|
||||
|
||||
.cell-more {
|
||||
margin-left: 10rpx;
|
||||
width: 32rpx;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.cell-more:after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
|
||||
border: 2rpx solid darken($color-line, 20%) {
|
||||
right-color: transparent;
|
||||
bottom-color: transparent;
|
||||
}
|
||||
|
||||
transform: rotate(135deg);
|
||||
}
|
||||
}
|
||||
|
||||
.edit-info-box {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 40rpx;
|
||||
min-height: 50rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.info-name {
|
||||
width: 150rpx;
|
||||
font-size: $font-size-base;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
font-size: $font-size-base;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.dynacode {
|
||||
margin: 0;
|
||||
padding: 0 10rpx;
|
||||
width: 250rpx;
|
||||
height: 60rpx;
|
||||
font-size: $font-size-base;
|
||||
line-height: 60rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.edit-sex-list {
|
||||
display: flex;
|
||||
|
||||
label {
|
||||
display: flex;
|
||||
margin-left: 30rpx;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
uni-radio .uni-radio-input {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.pick-regions {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.set-pass-tips {
|
||||
padding: 20rpx 20rpx 0 20rpx;
|
||||
}
|
||||
|
||||
.input-len {
|
||||
width: 500rpx !important;
|
||||
}
|
||||
|
||||
.save-item {
|
||||
margin-top: 50rpx;
|
||||
|
||||
button {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bind-mobile {
|
||||
button {
|
||||
border-radius: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
justify-content: center;
|
||||
padding-top: 80rpx;
|
||||
|
||||
.empty_img {
|
||||
width: 63%;
|
||||
height: 450rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 190rpx;
|
||||
color: $color-tip;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
button {
|
||||
min-width: 300rpx;
|
||||
margin-top: 100rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<template v-if="memberInfo">
|
||||
<!-- 修改用户名 -->
|
||||
<view v-if="indent == 'username'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("member.info_edit.l7") }}</text>
|
||||
<input class="uni-input info-content input-len" type="text" maxlength="30" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.username" />
|
||||
</view>
|
||||
<view class="color-tip font-size-goods-tag set-pass-tips">{{ $lang("member.info_edit.l10") }}</view>
|
||||
<view class="save-item" @click="save('username')">
|
||||
<button type="primary">{{ $lang("common.ns-login.l30.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改昵称 -->
|
||||
<view v-if="indent == 'name'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("common.ns-login.l87.t0") }}</text>
|
||||
<input class="uni-input info-content input-len" type="text" maxlength="30" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.nickName" />
|
||||
</view>
|
||||
<view class="save-item" @click="save('name')">
|
||||
<button type="primary">{{ $lang("common.ns-login.l30.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改真实姓名 -->
|
||||
<view v-if="indent == 'realName'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("order._components.common-payment.l138.t0") }}</text>
|
||||
<input class="uni-input info-content input-len" type="text" maxlength="30" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.realName" />
|
||||
</view>
|
||||
<view class="save-item" @click="save('realName')">
|
||||
<button type="primary">{{ $lang("common.ns-login.l30.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改性别 -->
|
||||
<view v-if="indent == 'sex'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("member.info.l37") }}</text>
|
||||
<radio-group @change="radioChange" class="edit-sex-list">
|
||||
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in items" :key="item.value">
|
||||
<view>
|
||||
<radio :color="themeStyle.main_color" :value="item.value" :checked="index === formData.sex" />
|
||||
</view>
|
||||
<view>{{ item.name }}</view>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
<view class="save-item" @click="save('sex')">
|
||||
<button type="primary">{{ $lang("common.ns-login.l30.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改生日 -->
|
||||
<view v-if="indent == 'birthday'" class="edit-info edit-birthday-list">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("member.info.l43") }}</text>
|
||||
<picker mode="date" :value="formData.birthday" :start="startDate" :end="endDate" @change="bindDateChange">
|
||||
<view class="uni-input">{{ formData.birthday ? formData.birthday : $lang('member.info_edit.l57') }}</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="save-item" @click="save('birthday')">
|
||||
<button type="primary">{{ $lang("common.ns-login.l30.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 修改密码 -->
|
||||
<view v-if="indent == 'password'" class="edit-info">
|
||||
<block v-if="memberInfo.password == 0 && memberInfo.mobile == ''">
|
||||
<view class="empty">
|
||||
<view class="empty_img">
|
||||
<image :src="$util.img('public/uniapp/common/common-empty.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="color-tip margin-top margin-bottom">{{ $lang("member.info_edit.l71") }}</view>
|
||||
<button type="primary" size="mini" class="mini button color-base-bg" @click="modifyInfo('mobile')">{{ $lang("member.info_edit.l72") }}</button>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="edit-info-box" v-if="memberInfo.password">
|
||||
<text class="info-name">{{ $lang("member.info_edit.l77") }}</text>
|
||||
<input class="uni-input info-content input-len" type="password" maxlength="30" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.currentPassword" />
|
||||
</view>
|
||||
<block v-else>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("member.info_edit.l82") }}</text>
|
||||
<input class="uni-input info-content" type="number" maxlength="4" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.mobileVercode" />
|
||||
<image :src="captcha.img" class="captcha" @click="getCaptcha" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("member.info_edit.l87") }}</text>
|
||||
<input class="uni-input info-content" type="number" maxlength="6" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.mobileDynacode" />
|
||||
<button type="primary" class="dynacode" @click="passwordMoblieCode()">{{ formData.mobileCodeText }}</button>
|
||||
</view>
|
||||
<view class="color-tip font-size-goods-tag set-pass-tips">
|
||||
点击“获取动态码”,将会向您已绑定的手机号{{ memberInfoformData.mobile | mobile }}发送验证码</view>
|
||||
</block>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("member.info_edit.l82") }}</text>
|
||||
<input class="uni-input info-content input-len" type="password" maxlength="30" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.newPassword" />
|
||||
</view>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("member.info_edit.l87") }}</text>
|
||||
<input class="uni-input info-content input-len" type="password" maxlength="30" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.confirmPassword" />
|
||||
</view>
|
||||
|
||||
<view class="save-item" @click="save('password')">
|
||||
<button type="primary">{{ $lang("common.ns-login.l30.t0") }}</button>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<!-- 修改手机号 -->
|
||||
<view v-if="indent == 'mobile'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("common.ns-login.l15.t0") }}</text>
|
||||
<input class="uni-input info-content" type="number" maxlength="11" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.mobile" />
|
||||
</view>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("common.ns-login.l19.t0") }}</text>
|
||||
<input class="uni-input info-content" type="number" maxlength="4" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.mobileVercode" />
|
||||
<image :src="captcha.img" class="captcha" @click="getCaptcha" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("member.info_edit.l120") }}</text>
|
||||
<input class="uni-input info-content" type="number" maxlength="6" placeholder=$lang("common.ns-form.l368.t0") v-model="formData.mobileDynacode" />
|
||||
<button type="primary" class="dynacode" @click="bindMoblieCode()">{{ formData.mobileCodeText }}</button>
|
||||
</view>
|
||||
<view class="save-item" @click="save('mobile')">
|
||||
<button type="primary">{{ $lang("common.ns-login.l30.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 绑定手机号 -->
|
||||
<view v-if="indent == 'bind_mobile'" class="edit-info">
|
||||
<view class="save-item bind-mobile">
|
||||
<button type="primary" open-type="getPhoneNumber" @getphonenumber="mobileAuth">{{ $lang("member.info_edit.l131") }}</button>
|
||||
</view>
|
||||
<view class="save-item bind-mobile">
|
||||
<button type="primary" @click="manualBinding">{{ $lang("member.info_edit.l134") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="indent == 'address'" class="edit-info">
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("member.info_edit.l139") }}</text>
|
||||
<pick-regions :default-regions="defaultRegions" select-arr="3" @getRegions="handleGetRegions">
|
||||
<text class="select-address " :class="{'color-tip': !formData.fullAddress }">
|
||||
{{ formData.fullAddress ? formData.fullAddress : $lang('member.address_edit.l44') }}
|
||||
</text>
|
||||
</pick-regions>
|
||||
</view>
|
||||
<view class="edit-info-box">
|
||||
<text class="info-name">{{ $lang("member.info_edit.l147") }}</text>
|
||||
<input class="uni-input info-content" type="text" placeholder=$lang("member.info_edit.l147") v-model="formData.address" />
|
||||
</view>
|
||||
<view class="save-item" @click="save('address')">
|
||||
<button type="primary">{{ $lang("common.ns-login.l30.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import info from './public/js/info.js';
|
||||
import auth from '@/common/js/auth.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {};
|
||||
},
|
||||
onLoad(data) {
|
||||
if (data.type) this.indent = data.type;
|
||||
},
|
||||
mixins: [info, auth],
|
||||
filters: {
|
||||
mobile(mobile) {
|
||||
return mobile.substring(0, 4 - 1) + '****' + mobile.substring(6 + 1);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.info-head {
|
||||
.head-nav {
|
||||
width: 100%;
|
||||
height: var(--status-bar-height);
|
||||
background: #ffffff;
|
||||
}
|
||||
|
||||
.head-nav.active {
|
||||
padding-top: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.captcha {
|
||||
width: 170rpx;
|
||||
height: 50rpx;
|
||||
}
|
||||
|
||||
.info-list-cell {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding: 24rpx 30rpx;
|
||||
position: relative;
|
||||
line-height: 50rpx;
|
||||
background-color: #fff;
|
||||
|
||||
&:first-child {
|
||||
padding: 28rpx 30rpx;
|
||||
}
|
||||
|
||||
.cell-tip1 {
|
||||
margin-right: 40rpx;
|
||||
}
|
||||
|
||||
&.log-out-btn {
|
||||
margin-top: 40rpx;
|
||||
|
||||
.cell-tit {
|
||||
margin: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.info-list-head {
|
||||
border: 1rpx solid $color-line;
|
||||
width: 82rpx;
|
||||
height: 82rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.info-list-head image {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
}
|
||||
|
||||
// #ifdef MP
|
||||
&.info-item {
|
||||
margin-top: 16rpx;
|
||||
}
|
||||
// #endif
|
||||
|
||||
&.info-list-con~&.info-list-con:after {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 30rpx;
|
||||
right: 30rpx;
|
||||
top: 0;
|
||||
border-bottom: 1rpx solid $color-line;
|
||||
}
|
||||
|
||||
.cell-tip {
|
||||
margin-left: auto;
|
||||
color: $color-tip;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 470rpx;
|
||||
}
|
||||
|
||||
.cell-more {
|
||||
margin-left: 10rpx;
|
||||
width: 32rpx;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.cell-more:after {
|
||||
content: '';
|
||||
display: block;
|
||||
width: 12rpx;
|
||||
height: 12rpx;
|
||||
|
||||
border: 2rpx solid darken($color-line, 20%) {
|
||||
right-color: transparent;
|
||||
bottom-color: transparent;
|
||||
}
|
||||
|
||||
transform: rotate(135deg);
|
||||
}
|
||||
}
|
||||
|
||||
.edit-info-box {
|
||||
margin-top: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 40rpx;
|
||||
min-height: 50rpx;
|
||||
background-color: #fff;
|
||||
|
||||
.info-name {
|
||||
width: 150rpx;
|
||||
font-size: $font-size-base;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
.info-content {
|
||||
flex: 1;
|
||||
width: 0;
|
||||
font-size: $font-size-base;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.dynacode {
|
||||
margin: 0;
|
||||
padding: 0 10rpx;
|
||||
width: 250rpx;
|
||||
height: 60rpx;
|
||||
font-size: $font-size-base;
|
||||
line-height: 60rpx;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.edit-sex-list {
|
||||
display: flex;
|
||||
|
||||
label {
|
||||
display: flex;
|
||||
margin-left: 30rpx;
|
||||
align-items: center;
|
||||
}
|
||||
}
|
||||
|
||||
uni-radio .uni-radio-input {
|
||||
width: 32rpx;
|
||||
height: 32rpx;
|
||||
}
|
||||
|
||||
.pick-regions {
|
||||
flex: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.set-pass-tips {
|
||||
padding: 20rpx 20rpx 0 20rpx;
|
||||
}
|
||||
|
||||
.input-len {
|
||||
width: 500rpx !important;
|
||||
}
|
||||
|
||||
.save-item {
|
||||
margin-top: 50rpx;
|
||||
|
||||
button {
|
||||
font-size: 30rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.bind-mobile {
|
||||
button {
|
||||
border-radius: 60rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.empty {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: $padding;
|
||||
box-sizing: border-box;
|
||||
justify-content: center;
|
||||
padding-top: 80rpx;
|
||||
|
||||
.empty_img {
|
||||
width: 63%;
|
||||
height: 450rpx;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
font-size: 190rpx;
|
||||
color: $color-tip;
|
||||
line-height: 1.2;
|
||||
}
|
||||
|
||||
button {
|
||||
min-width: 300rpx;
|
||||
margin-top: 100rpx;
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,278 +1,278 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view v-if="info" style="background-color: #fff;">
|
||||
|
||||
<view class="invite_adv">
|
||||
<image :src="$util.img('public/uniapp/member/invite/top_bg.png')" mode="widthFix"></image>
|
||||
|
||||
<view class="desc" @click="openRulePopup" v-if="info.remark != ''">
|
||||
<text class="iconfont icon-bangzhu"></text>
|
||||
活动说明
|
||||
</view>
|
||||
<image class="font" :src="$util.img('public/uniapp/member/invite/top_font.png')" mode="widthFix" show-menu-by-longpress />
|
||||
<view class="time">
|
||||
活动时间:{{ $util.timeStampTurnTime(info.start_time, 1) }}至{{ $util.timeStampTurnTime(info.end_time, 1) }}
|
||||
</view>
|
||||
|
||||
<view class="btn" :style="{ 'background-image': 'url(' + $util.img('public/uniapp/member/invite/top_btn.png') + ')' }" @click="openSharePopup">立即邀请</view>
|
||||
</view>
|
||||
<view class="content invite-list">
|
||||
<view class="title">我的好友</view>
|
||||
<block v-if="inviteList.length > 0">
|
||||
<view class="invitelist_block">
|
||||
<view class="invitelist">
|
||||
<view class="list-item" v-for="(item, index) in inviteList" :key="index">
|
||||
<view class="img color-base-border">
|
||||
<image mode="aspectFit" :src="item.headimg == '' ? $util.img($util.getDefaultImage().head) : $util.img(item.headimg)" show-menu-by-longpress />
|
||||
</view>
|
||||
<view class="list-left">
|
||||
<view class="info">
|
||||
<view class="name font-size-tag">{{ item.source_member_nickname }}</view>
|
||||
<view class="time font-size-activity-tag color-tip">
|
||||
{{ $util.timeStampTurnTime(item.create_time) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="prize color-base-text font-size-activity-tag">
|
||||
<block v-if="item.balance > 0">{{ item.balance }}元现金红包</block>
|
||||
<block v-if="(item.point > 0 || item.coupon_num) && item.balance > 0">+</block>
|
||||
<block v-if="item.point > 0">{{ parseInt(item.point) }}积分</block>
|
||||
<block v-if="item.point > 0 && item.balance > 0 && item.coupon_num > 0">+
|
||||
</block>
|
||||
<block v-if="item.coupon_num > 0">{{ item.coupon_num }}张优惠券</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="more_invite color-tip font-size-tag " @click="moreList" v-if="isClick && total_num > page">
|
||||
查看更多
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</view>
|
||||
<view class="more_invite color-tip font-size-tag " @click="moreList" v-if="!isClick && inviteList.length > 5 && total_num <= page">没有更多数据了</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="empty">
|
||||
<view class="tip">您还没有邀请到新朋友哦</view>
|
||||
<view class="tip">邀请好友,赚取好礼。赶紧去试试吧~</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="title">邀请好友奖励</view>
|
||||
<view class="invite_active">
|
||||
<view class="list">
|
||||
<view class="item" v-if="$util.inArray('balance', info.type) != -1">
|
||||
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill"/>
|
||||
<view class="desc">
|
||||
<view class="price">
|
||||
<text class="font-size-base">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text>{{ info.balance }}</text>
|
||||
</view>
|
||||
<view class="type">现金红包</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item" v-if="$util.inArray('point', info.type) != -1">
|
||||
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill"/>
|
||||
<view class="desc">
|
||||
<view class="price">
|
||||
<text>{{ parseInt(info.point) }}</text>
|
||||
</view>
|
||||
<view class="type">积分</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item margin_right_none" v-if="$util.inArray('coupon', info.type) != -1">
|
||||
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill">
|
||||
</image>
|
||||
<view class="desc">
|
||||
<view class="price">
|
||||
<text>{{ info.coupon.split(',').length }}</text>
|
||||
张
|
||||
</view>
|
||||
<view class="type">优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view class="title_desc color-tip">分享给好友,让好友通过你的分享链接进入并注册登录,可获得以下奖励:</view>
|
||||
<view class="desc_list">
|
||||
<view class="" v-if="$util.inArray('balance', info.type) != -1">
|
||||
<text>●</text>
|
||||
可得{{ info.balance }}元红包奖励
|
||||
</view>
|
||||
<view class="" v-if="$util.inArray('point', info.type) != -1">
|
||||
<text>●</text>
|
||||
可得{{ info.point }}积分
|
||||
</view>
|
||||
<view class="" v-if="$util.inArray('coupon', info.type) != -1">
|
||||
<text>●</text>
|
||||
可得{{ info.coupon.split(',').length }}张优惠券
|
||||
</view>
|
||||
|
||||
<view class="" v-if="info.max_fetch == 0">
|
||||
<text>●</text>
|
||||
可得奖励不受限制
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<text>●</text>
|
||||
奖励上限为{{ info.max_fetch }}人
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="title">如何邀请好友</view>
|
||||
<view class="invite_active">
|
||||
<view class="step">
|
||||
<view>
|
||||
<view class="img">
|
||||
<image :src="$util.img('public/uniapp/member/invite/fenxiang.png')" mode="aspectFit" show-menu-by-longpress />
|
||||
</view>
|
||||
<view class="text">分享链接给好友</view>
|
||||
</view>
|
||||
<view>
|
||||
<image :src="$util.img('public/uniapp/member/invite/jiantou.png')" class="jiantou" show-menu-by-longpress ></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="img">
|
||||
<image :src="$util.img('public/uniapp/member/invite/shouji.png')" mode="aspectFit" show-menu-by-longpress />
|
||||
</view>
|
||||
<view class="text">好友进入</view>
|
||||
</view>
|
||||
<view>
|
||||
<image :src="$util.img('public/uniapp/member/invite/jiantou.png')" class="jiantou" show-menu-by-longpress ></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="img">
|
||||
<image :src="$util.img('public/uniapp/member/invite/hongbao.png')" mode="aspectFit" show-menu-by-longpress />
|
||||
</view>
|
||||
<view class="text">好友注册成功获得奖励</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 海报 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="posterPopup" type="bottom" class="poster-layer">
|
||||
<template v-if="poster != '-1'">
|
||||
<view>
|
||||
<view class="image-wrap">
|
||||
<image :src="$util.img(poster)" mode="widthFix" show-menu-by-longpress />
|
||||
</view>
|
||||
<!-- #ifdef MP || APP-PLUS -->
|
||||
<view class="save" @click="savePoster()">保存图片</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="save">长按保存图片</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="close iconfont icon-close" @click="closePosterPopup()"></view>
|
||||
</template>
|
||||
<view v-else class="msg">{{ posterMsg }}</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<!-- 分享弹窗 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="sharePopup" type="bottom" class="share-popup">
|
||||
<view>
|
||||
<view class="share-title">分享</view>
|
||||
<view class="share-content">
|
||||
<!-- #ifdef MP -->
|
||||
<view class="share-box">
|
||||
<button class="share-btn" :plain="true" open-type="share">
|
||||
<view class="iconfont icon-share-friend"></view>
|
||||
<text>分享给好友</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="share-box" @click="openPosterPopup">
|
||||
<button class="share-btn" :plain="true">
|
||||
<view class="iconfont icon-pengyouquan"></view>
|
||||
<text>生成分享海报</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="share-box" @click="copyUrl">
|
||||
<button class="share-btn" :plain="true">
|
||||
<view class="iconfont icon-fuzhilianjie"></view>
|
||||
<text>复制链接</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="share-footer" @click="closeSharePopup"><text>取消分享</text></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<!-- 弹出规则 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="rulePopup" type="bottom">
|
||||
<view class="tips-layer">
|
||||
<view class="head" @click="closeRulePopup()">
|
||||
<view class="title">活动说明</view>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="detail margin-bottom">{{ info.remark }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
<ns-empty v-else text="暂无相关数据"></ns-empty>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import inviteFriends from './public/js/invite_friends.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
inviteList: [],
|
||||
info: null,
|
||||
page: 1,
|
||||
page_size: 5,
|
||||
total_num: 0,
|
||||
isClick: true,
|
||||
poster: '-1', //海报
|
||||
posterMsg: '' //海报错误信息
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.getBaseInfo();
|
||||
if (this.storeToken) {
|
||||
this.getList();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/invite_friends');
|
||||
});
|
||||
}
|
||||
},
|
||||
onShow() {},
|
||||
mixins: [inviteFriends],
|
||||
onReady() {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/invite_friends.scss';
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .uni-popup__wrapper.bottom {
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.poster-layer>>>.uni-popup__wrapper-box {
|
||||
max-height: initial !important;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view v-if="info" style="background-color: #fff;">
|
||||
|
||||
<view class="invite_adv">
|
||||
<image :src="$util.img('public/uniapp/member/invite/top_bg.png')" mode="widthFix"></image>
|
||||
|
||||
<view class="desc" @click="openRulePopup" v-if="info.remark != ''">
|
||||
<text class="iconfont icon-bangzhu"></text>
|
||||
活动说明
|
||||
</view>
|
||||
<image class="font" :src="$util.img('public/uniapp/member/invite/top_font.png')" mode="widthFix" show-menu-by-longpress />
|
||||
<view class="time">
|
||||
活动时间:{{ $util.timeStampTurnTime(info.start_time, 1) }}至{{ $util.timeStampTurnTime(info.end_time, 1) }}
|
||||
</view>
|
||||
|
||||
<view class="btn" :style="{ 'background-image': 'url(' + $util.img('public/uniapp/member/invite/top_btn.png') + ')' }" @click="openSharePopup">{{ $lang("member.invite_friends.l17") }}</view>
|
||||
</view>
|
||||
<view class="content invite-list">
|
||||
<view class="title">{{ $lang("member.invite_friends.l20") }}</view>
|
||||
<block v-if="inviteList.length > 0">
|
||||
<view class="invitelist_block">
|
||||
<view class="invitelist">
|
||||
<view class="list-item" v-for="(item, index) in inviteList" :key="index">
|
||||
<view class="img color-base-border">
|
||||
<image mode="aspectFit" :src="item.headimg == '' ? $util.img($util.getDefaultImage().head) : $util.img(item.headimg)" show-menu-by-longpress />
|
||||
</view>
|
||||
<view class="list-left">
|
||||
<view class="info">
|
||||
<view class="name font-size-tag">{{ item.source_member_nickname }}</view>
|
||||
<view class="time font-size-activity-tag color-tip">
|
||||
{{ $util.timeStampTurnTime(item.create_time) }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="prize color-base-text font-size-activity-tag">
|
||||
<block v-if="item.balance > 0">{{ item.balance }}元现金红包</block>
|
||||
<block v-if="(item.point > 0 || item.coupon_num) && item.balance > 0">+</block>
|
||||
<block v-if="item.point > 0">{{ parseInt(item.point) }}积分</block>
|
||||
<block v-if="item.point > 0 && item.balance > 0 && item.coupon_num > 0">+
|
||||
</block>
|
||||
<block v-if="item.coupon_num > 0">{{ item.coupon_num }}张优惠券</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="more_invite color-tip font-size-tag " @click="moreList" v-if="isClick && total_num > page">
|
||||
查看更多
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</view>
|
||||
<view class="more_invite color-tip font-size-tag " @click="moreList" v-if="!isClick && inviteList.length > 5 && total_num <= page">{{ $lang("member.invite_friends.l50") }}</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="empty">
|
||||
<view class="tip">{{ $lang("member.invite_friends.l55") }}</view>
|
||||
<view class="tip">{{ $lang("member.invite_friends.l56") }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="title">{{ $lang("member.invite_friends.l61") }}</view>
|
||||
<view class="invite_active">
|
||||
<view class="list">
|
||||
<view class="item" v-if="$util.inArray('balance', info.type) != -1">
|
||||
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill"/>
|
||||
<view class="desc">
|
||||
<view class="price">
|
||||
<text class="font-size-base">{{ $lang('common.currency_symbol') }}</text>
|
||||
<text>{{ info.balance }}</text>
|
||||
</view>
|
||||
<view class="type">{{ $lang("member.invite_friends.l71") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item" v-if="$util.inArray('point', info.type) != -1">
|
||||
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill"/>
|
||||
<view class="desc">
|
||||
<view class="price">
|
||||
<text>{{ parseInt(info.point) }}</text>
|
||||
</view>
|
||||
<view class="type">{{ $lang("common.register-reward.l19.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="item margin_right_none" v-if="$util.inArray('coupon', info.type) != -1">
|
||||
<image :src="$util.img('public/uniapp/member/invite/coupon_bg.png')" mode="aspectFill">
|
||||
</image>
|
||||
<view class="desc">
|
||||
<view class="price">
|
||||
<text>{{ info.coupon.split(',').length }}</text>
|
||||
张
|
||||
</view>
|
||||
<view class="type">{{ $lang("diy.diy-coupon.l209.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc">
|
||||
<view class="title_desc color-tip">{{ $lang("member.invite_friends.l98") }}</view>
|
||||
<view class="desc_list">
|
||||
<view class="" v-if="$util.inArray('balance', info.type) != -1">
|
||||
<text>●</text>
|
||||
可得{{ info.balance }}元红包奖励
|
||||
</view>
|
||||
<view class="" v-if="$util.inArray('point', info.type) != -1">
|
||||
<text>●</text>
|
||||
可得{{ info.point }}积分
|
||||
</view>
|
||||
<view class="" v-if="$util.inArray('coupon', info.type) != -1">
|
||||
<text>●</text>
|
||||
可得{{ info.coupon.split(',').length }}张优惠券
|
||||
</view>
|
||||
|
||||
<view class="" v-if="info.max_fetch == 0">
|
||||
<text>●</text>
|
||||
可得奖励不受限制
|
||||
</view>
|
||||
<view class="" v-else>
|
||||
<text>●</text>
|
||||
奖励上限为{{ info.max_fetch }}人
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="content">
|
||||
<view class="title">{{ $lang("member.invite_friends.l126") }}</view>
|
||||
<view class="invite_active">
|
||||
<view class="step">
|
||||
<view>
|
||||
<view class="img">
|
||||
<image :src="$util.img('public/uniapp/member/invite/fenxiang.png')" mode="aspectFit" show-menu-by-longpress />
|
||||
</view>
|
||||
<view class="text">{{ $lang("member.invite_friends.l133") }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<image :src="$util.img('public/uniapp/member/invite/jiantou.png')" class="jiantou" show-menu-by-longpress ></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="img">
|
||||
<image :src="$util.img('public/uniapp/member/invite/shouji.png')" mode="aspectFit" show-menu-by-longpress />
|
||||
</view>
|
||||
<view class="text">{{ $lang("member.invite_friends.l142") }}</view>
|
||||
</view>
|
||||
<view>
|
||||
<image :src="$util.img('public/uniapp/member/invite/jiantou.png')" class="jiantou" show-menu-by-longpress ></image>
|
||||
</view>
|
||||
<view>
|
||||
<view class="img">
|
||||
<image :src="$util.img('public/uniapp/member/invite/hongbao.png')" mode="aspectFit" show-menu-by-longpress />
|
||||
</view>
|
||||
<view class="text">{{ $lang("member.invite_friends.l151") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 海报 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="posterPopup" type="bottom" class="poster-layer">
|
||||
<template v-if="poster != '-1'">
|
||||
<view>
|
||||
<view class="image-wrap">
|
||||
<image :src="$util.img(poster)" mode="widthFix" show-menu-by-longpress />
|
||||
</view>
|
||||
<!-- #ifdef MP || APP-PLUS -->
|
||||
<view class="save" @click="savePoster()">{{ $lang("goods._components.goods-detail-view.l397.t0") }}</view>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="save">{{ $lang("fenxiao.goods_list.l118") }}</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="close iconfont icon-close" @click="closePosterPopup()"></view>
|
||||
</template>
|
||||
<view v-else class="msg">{{ posterMsg }}</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<!-- 分享弹窗 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="sharePopup" type="bottom" class="share-popup">
|
||||
<view>
|
||||
<view class="share-title">{{ $lang("goods._components.goods-detail-view.l411.t0") }}</view>
|
||||
<view class="share-content">
|
||||
<!-- #ifdef MP -->
|
||||
<view class="share-box">
|
||||
<button class="share-btn" :plain="true" open-type="share">
|
||||
<view class="iconfont icon-share-friend"></view>
|
||||
<text>{{ $lang("goods._components.goods-detail-view.l417.t0") }}</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
<view class="share-box" @click="openPosterPopup">
|
||||
<button class="share-btn" :plain="true">
|
||||
<view class="iconfont icon-pengyouquan"></view>
|
||||
<text>{{ $lang("goods._components.goods-detail-view.l434.t0") }}</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #ifdef H5 -->
|
||||
<view class="share-box" @click="copyUrl">
|
||||
<button class="share-btn" :plain="true">
|
||||
<view class="iconfont icon-fuzhilianjie"></view>
|
||||
<text>{{ $lang("goods._components.goods-detail-view.l441.t0") }}</text>
|
||||
</button>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
<view class="share-footer" @click="closeSharePopup"><text>{{ $lang("goods._components.goods-detail-view.l446.t0") }}</text></view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
|
||||
<!-- 弹出规则 -->
|
||||
<view @touchmove.prevent.stop>
|
||||
<uni-popup ref="rulePopup" type="bottom">
|
||||
<view class="tips-layer">
|
||||
<view class="head" @click="closeRulePopup()">
|
||||
<view class="title">{{ $lang("member.invite_friends.l217") }}</view>
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="detail margin-bottom">{{ info.remark }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</view>
|
||||
</view>
|
||||
<ns-empty v-else text=$lang("common.ns-empty.l18.t0")></ns-empty>
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import inviteFriends from './public/js/invite_friends.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
inviteList: [],
|
||||
info: null,
|
||||
page: 1,
|
||||
page_size: 5,
|
||||
total_num: 0,
|
||||
isClick: true,
|
||||
poster: '-1', //海报
|
||||
posterMsg: '' //海报错误信息
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.getBaseInfo();
|
||||
if (this.storeToken) {
|
||||
this.getList();
|
||||
} else {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/invite_friends');
|
||||
});
|
||||
}
|
||||
},
|
||||
onShow() {},
|
||||
mixins: [inviteFriends],
|
||||
onReady() {}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/invite_friends.scss';
|
||||
</style>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .uni-popup__wrapper.bottom {
|
||||
border-radius: 24rpx 24rpx 0 0;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
.poster-layer>>>.uni-popup__wrapper-box {
|
||||
max-height: initial !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,372 +1,372 @@
|
||||
<template>
|
||||
<view :style="themeColor" class="member-level">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/level-top-bg.png')"></image>
|
||||
</view>
|
||||
<view class="banner-container">
|
||||
<view class="memberInfo" v-if="memberInfo">
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg" @error="memberInfo.headimg = $util.getDefaultImage().head" mode="aspectFill" show-menu-by-longpress></image>
|
||||
<image :src="$util.getDefaultImage().head" v-else mode="aspectFill" show-menu-by-longpress></image>
|
||||
<view class="member-desc">
|
||||
<view class="font-size-base">{{ memberInfo.nickname }}</view>
|
||||
<view class="font-size-activity-tag">当前等级:{{ memberInfo.member_level_name }}</view>
|
||||
</view>
|
||||
<view class="growth-rules font-size-tag" @click="growthRules">
|
||||
<text class="iconfont icon-wenhao font-size-tag"></text>
|
||||
成长规则
|
||||
</view>
|
||||
</view>
|
||||
<swiper :style="{ width: '100vw', height: '390rpx' }" class="margin-bottom"
|
||||
:indicator-dots="swiperConfig.indicatorDots" :indicator-color="swiperConfig.indicatorColor"
|
||||
:indicator-active-color="swiperConfig.indicatorActiveColor" :autoplay="false"
|
||||
:interval="swiperConfig.interval" :duration="swiperConfig.duration" :circular="swiperConfig.circular"
|
||||
:previous-margin="swiperConfig.previousMargin" :next-margin="swiperConfig.nextMargin"
|
||||
@change="swiperChange" @animationfinish="animationfinish" :current="curIndex">
|
||||
<swiper-item :class="levelList.length == 1 ? 'image-container-box' : ''" v-for="(item, i) in levelList"
|
||||
:key="i">
|
||||
<view class="image-container" :class="[
|
||||
curIndex === 0
|
||||
? i === listLen - 1
|
||||
? 'item-left'
|
||||
: i === 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
: curIndex === listLen - 1
|
||||
? i === 0
|
||||
? 'item-right'
|
||||
: i === listLen - 2
|
||||
? 'item-left'
|
||||
: 'item-center'
|
||||
: i === curIndex - 1
|
||||
? 'item-left'
|
||||
: i === curIndex + 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
]">
|
||||
<view class="slide-image" style="background-size: 100% 100%;background-repeat:no-repeat" :style="{
|
||||
transform: curIndex === i ? 'scale(' + scaleX + ',' + scaleY + ')' : 'scale(1,1)',
|
||||
transitionDuration: '.3s',
|
||||
transitionTimingFunction: 'ease'
|
||||
}">
|
||||
<image v-if="levelList[curIndex]['level_picture']" :src="$util.img(levelList[curIndex]['level_picture'])" show-menu-by-longpress/>
|
||||
<image v-else :style="{backgroundColor:levelList[curIndex]['bg_color']}"/>
|
||||
|
||||
<view class="info">
|
||||
<view class="level-detail" :style="{color:levelList[curIndex]['level_text_color']}">
|
||||
{{ levelList[curIndex].level_name }}
|
||||
<text class="isnow " :style="{color:levelList[curIndex]['level_text_color']}" v-if="levelId == item.level_id">当前等级</text>
|
||||
</view>
|
||||
<view class="growr-name" :style="{color:levelList[curIndex]['level_text_color']}">当前成长值</view>
|
||||
<view class="growr-value" :style="{color:levelList[curIndex]['level_text_color']}">{{ growth }}</view>
|
||||
<block v-if="levelId == item.level_id">
|
||||
<block v-if="levelList[curIndex + 1] != undefined">
|
||||
<ns-progress :progress="levelList[curIndex + 1].rate"></ns-progress>
|
||||
<view class="residue-growr-value"
|
||||
:style="{color:levelList[curIndex]['level_text_color']}">
|
||||
再获得{{ levelList[curIndex + 1].needGrowth > 0 ? levelList[curIndex + 1].needGrowth : 0 }}成长值成为{{
|
||||
levelList[curIndex + 1].level_name
|
||||
}}
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="residue-growr-value" :style="{color:levelList[curIndex]['level_text_color']}">您现在已经是最高等级</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-progress :progress="levelList[curIndex].rate" v-if="levelList[curIndex].needGrowth > 0"></ns-progress>
|
||||
<view class="residue-growr-value" v-if="levelList[curIndex].needGrowth > 0" :style="{color:levelList[curIndex]['level_text_color']}">
|
||||
再获得{{ levelList[curIndex].needGrowth }}成长值成为{{ levelList[curIndex].level_name }}
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="member-equity" v-if="levelList[curIndex].is_free_shipping > 0 || levelList[curIndex].consume_discount > 0 || levelList[curIndex].point_feedback > 0">
|
||||
<view class="equity-title">会员权益</view>
|
||||
<view class="equity-itme" v-if="levelList[curIndex].is_free_shipping > 0">
|
||||
<image :src="$util.img('public/uniapp/level/exemption_postage.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="equity-content" :class="{ active: levelList[curIndex].consume_discount > 0 }">
|
||||
<text>包邮服务</text>
|
||||
<text class="equity-desc">提供商品包邮服务</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="equity-itme" v-if="levelList[curIndex].consume_discount > 0">
|
||||
<image :src="$util.img('public/uniapp/level/consumption_discount.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="equity-content" :class="{ active: levelList[curIndex].point_feedback > 0 }">
|
||||
<text>享受消费折扣服务</text>
|
||||
<text class="equity-desc" v-if="levelList[curIndex].is_default == 1">不享受任何消费折扣和其他权益</text>
|
||||
<text class="equity-desc" v-else>提供{{ levelList[curIndex].consume_discount }}折消费折扣</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="equity-itme" v-if="levelList[curIndex].point_feedback > 0">
|
||||
<image :src="$util.img('public/uniapp/level/integral_feedback.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="equity-content">
|
||||
<text>享受积分回馈服务</text>
|
||||
<text class="equity-desc">提供{{ levelList[curIndex].point_feedback }}倍积分回馈倍率</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="member-gift" v-if="levelList[curIndex].send_balance > 0 || levelList[curIndex].send_balance > 0 || levelList[curIndex].send_coupon">
|
||||
<view class="gift-title">会员礼包</view>
|
||||
<view class="gift-itme" v-if="levelList[curIndex].send_point > 0">
|
||||
<image :src="$util.img('public/uniapp/level/integral.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="gift-content" :class="{ active: levelList[curIndex].send_balance > 0 }">
|
||||
<text>积分礼包</text>
|
||||
<text class="gift-desc">赠送{{ levelList[curIndex].send_point }}积分</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="gift-itme" v-if="levelList[curIndex].send_balance > 0">
|
||||
<image :src="$util.img('public/uniapp/level/red_packet.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="gift-content" :class="{ active: levelList[curIndex].send_coupon }">
|
||||
<text>红包礼包</text>
|
||||
<text class="gift-desc">赠送{{ levelList[curIndex].send_balance }}元红包</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="gift-itme" v-if="levelList[curIndex].send_coupon" @click="openCoupon(levelList[curIndex].send_coupon)">
|
||||
<image :src="$util.img('public/uniapp/level/coupon.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="gift-content">
|
||||
<text>优惠券礼包</text>
|
||||
<text class="gift-desc">赠送{{ levelList[curIndex].coupon_length }}张优惠券</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 优惠券 -->
|
||||
<uni-popup ref="couponPopup" type="bottom">
|
||||
<view class="coupon-popup-box">
|
||||
<view class="coupon-popup-title" @click="closeCoupon">
|
||||
优惠券
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<scroll-view class="coupon-popup-content" scroll-y>
|
||||
<view class="coupon-item" v-for="(item, index) in couponPopList" :key="index">
|
||||
<view class="coupon-name">
|
||||
<text class="name">{{ item.coupon_name }}</text>
|
||||
<text class="desc"></text>
|
||||
</view>
|
||||
<view class="coupon-price" v-if="item.type == 'reward'">
|
||||
<text>{{ item.money }}</text>
|
||||
元
|
||||
</view>
|
||||
<view class="coupon-price" v-if="item.type == 'discount'">
|
||||
<text>{{ $util.numberFixed(item.discount, 1) }}</text>
|
||||
折
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
export default {
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
couponPopList: [],
|
||||
curIndex: 0,
|
||||
descIndex: 0,
|
||||
isDescAnimating: false,
|
||||
scaleX: (634 / 540).toFixed(4),
|
||||
scaleY: (378 / 330).toFixed(4),
|
||||
swiperConfig: {
|
||||
indicatorDots: false,
|
||||
indicatorColor: 'rgba(255, 255, 255, .4)',
|
||||
indicatorActiveColor: 'rgba(255, 255, 255, 1)',
|
||||
interval: 3000,
|
||||
duration: 300,
|
||||
circular: false,
|
||||
previousMargin: '58rpx',
|
||||
nextMargin: '58rpx'
|
||||
},
|
||||
levelList: [{
|
||||
needGrowth: 0,
|
||||
growth: 0
|
||||
}],
|
||||
levelId: 0,
|
||||
growth: 0,
|
||||
|
||||
nowIndex: 0, //我当前所在等级的index
|
||||
rule: [] //成长值规则
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
},
|
||||
remark() {
|
||||
if (this.levelList[this.curIndex]) {
|
||||
return this.levelList[this.curIndex].remark;
|
||||
}
|
||||
},
|
||||
nextIndex() {
|
||||
let num = 0;
|
||||
if (this.curIndex == this.levelList.length - 1) {
|
||||
return this.curIndex;
|
||||
} else {
|
||||
return this.curIndex + 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getLevelRule();
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/level');
|
||||
});
|
||||
} else {
|
||||
this.getLevelList();
|
||||
}
|
||||
// #ifdef MP-ALIPAY
|
||||
this.scaleX = 1
|
||||
this.scaleY = 1
|
||||
// #endif
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
filters: {
|
||||
rate(index, list, growth) {
|
||||
let nowGrowth = Number(growth);
|
||||
let minGrouth = Number(list[index].growth);
|
||||
if (index == list.length - 1) {
|
||||
return nowGrowth > minGrouth ? 100 : 0;
|
||||
} else {
|
||||
let maxGrouth = Number(list[index + 1].growth);
|
||||
let num2 = nowGrowth - minGrouth;
|
||||
let num1 = maxGrouth - minGrouth;
|
||||
let num = Math.floor((num2 / num1) * 100);
|
||||
return num > 100 ? 100 : num;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
let that = this;
|
||||
this.curIndex = e.detail.current;
|
||||
this.isDescAnimating = true;
|
||||
let timer = setTimeout(function() {
|
||||
that.descIndex = e.detail.current;
|
||||
clearTimeout(timer);
|
||||
}, 150);
|
||||
},
|
||||
animationfinish(e) {
|
||||
this.isDescAnimating = false;
|
||||
},
|
||||
getBannerDetail(index) {
|
||||
uni.showLoading({
|
||||
title: '将前往详情页面',
|
||||
duration: 2000,
|
||||
mask: true
|
||||
});
|
||||
},
|
||||
getLevelList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberlevel/lists',
|
||||
success: res => {
|
||||
if (res.data && res.code == 0) {
|
||||
this.levelList = res.data;
|
||||
for (var i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].send_coupon) {
|
||||
this.levelList[i].coupon_length = this.levelList[i].send_coupon.split(',')
|
||||
.length;
|
||||
}
|
||||
}
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
this.growth = this.memberInfo.growth;
|
||||
for (let i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].level_id == this.levelId) {
|
||||
this.curIndex = i;
|
||||
this.descIndex = i;
|
||||
this.nowIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.levelList.forEach((v, i) => {
|
||||
if (parseFloat(v.growth) < parseFloat(this.growth)) {
|
||||
v.needGrowth = 0;
|
||||
v.rate = 100;
|
||||
} else {
|
||||
v.needGrowth = (parseFloat(v.growth) - parseFloat(this.growth))
|
||||
.toFixed(2);
|
||||
v.rate = (this.growth / v.growth).toFixed(2) * 100;
|
||||
}
|
||||
});
|
||||
|
||||
this.levelList.forEach(v => {
|
||||
if (v.consume_discount) {
|
||||
v.consume_discount = (v.consume_discount / 10).toFixed(2);
|
||||
}
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getLevelRule() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/accountrule',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data && res.data.growth) {
|
||||
this.rule = res.data.growth;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
growthRules() {
|
||||
this.$util.redirectTo('/pages_tool/member/level_growth_rules');
|
||||
},
|
||||
openCoupon(data) {
|
||||
this.couponPopList = [];
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/couponbyid',
|
||||
data: {
|
||||
id: data
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.couponPopList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.$refs.couponPopup.open();
|
||||
},
|
||||
closeCoupon() {
|
||||
this.$refs.couponPopup.close();
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
return true;
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getLevelList();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/level.scss';
|
||||
<template>
|
||||
<view :style="themeColor" class="member-level">
|
||||
<view class="level-top">
|
||||
<image :src="$util.img('public/uniapp/level/level-top-bg.png')"></image>
|
||||
</view>
|
||||
<view class="banner-container">
|
||||
<view class="memberInfo" v-if="memberInfo">
|
||||
<image :src="$util.img(memberInfo.headimg)" v-if="memberInfo.headimg" @error="memberInfo.headimg = $util.getDefaultImage().head" mode="aspectFill" show-menu-by-longpress></image>
|
||||
<image :src="$util.getDefaultImage().head" v-else mode="aspectFill" show-menu-by-longpress></image>
|
||||
<view class="member-desc">
|
||||
<view class="font-size-base">{{ memberInfo.nickname }}</view>
|
||||
<view class="font-size-activity-tag">{ $lang("member.level.l12") } memberInfo.member_level_name }}</view>
|
||||
</view>
|
||||
<view class="growth-rules font-size-tag" @click="growthRules">
|
||||
<text class="iconfont icon-wenhao font-size-tag"></text>
|
||||
成长规则
|
||||
</view>
|
||||
</view>
|
||||
<swiper :style="{ width: '100vw', height: '390rpx' }" class="margin-bottom"
|
||||
:indicator-dots="swiperConfig.indicatorDots" :indicator-color="swiperConfig.indicatorColor"
|
||||
:indicator-active-color="swiperConfig.indicatorActiveColor" :autoplay="false"
|
||||
:interval="swiperConfig.interval" :duration="swiperConfig.duration" :circular="swiperConfig.circular"
|
||||
:previous-margin="swiperConfig.previousMargin" :next-margin="swiperConfig.nextMargin"
|
||||
@change="swiperChange" @animationfinish="animationfinish" :current="curIndex">
|
||||
<swiper-item :class="levelList.length == 1 ? 'image-container-box' : ''" v-for="(item, i) in levelList"
|
||||
:key="i">
|
||||
<view class="image-container" :class="[
|
||||
curIndex === 0
|
||||
? i === listLen - 1
|
||||
? 'item-left'
|
||||
: i === 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
: curIndex === listLen - 1
|
||||
? i === 0
|
||||
? 'item-right'
|
||||
: i === listLen - 2
|
||||
? 'item-left'
|
||||
: 'item-center'
|
||||
: i === curIndex - 1
|
||||
? 'item-left'
|
||||
: i === curIndex + 1
|
||||
? 'item-right'
|
||||
: 'item-center'
|
||||
]">
|
||||
<view class="slide-image" style="background-size: 100% 100%;background-repeat:no-repeat" :style="{
|
||||
transform: curIndex === i ? 'scale(' + scaleX + ',' + scaleY + ')' : 'scale(1,1)',
|
||||
transitionDuration: '.3s',
|
||||
transitionTimingFunction: 'ease'
|
||||
}">
|
||||
<image v-if="levelList[curIndex]['level_picture']" :src="$util.img(levelList[curIndex]['level_picture'])" show-menu-by-longpress/>
|
||||
<image v-else :style="{backgroundColor:levelList[curIndex]['bg_color']}"/>
|
||||
|
||||
<view class="info">
|
||||
<view class="level-detail" :style="{color:levelList[curIndex]['level_text_color']}">
|
||||
{{ levelList[curIndex].level_name }}
|
||||
<text class="isnow " :style="{color:levelList[curIndex]['level_text_color']}" v-if="levelId == item.level_id">{{ $lang("member.level.l57") }}</text>
|
||||
</view>
|
||||
<view class="growr-name" :style="{color:levelList[curIndex]['level_text_color']}">{{ $lang("member.level.l59") }}</view>
|
||||
<view class="growr-value" :style="{color:levelList[curIndex]['level_text_color']}">{{ growth }}</view>
|
||||
<block v-if="levelId == item.level_id">
|
||||
<block v-if="levelList[curIndex + 1] != undefined">
|
||||
<ns-progress :progress="levelList[curIndex + 1].rate"></ns-progress>
|
||||
<view class="residue-growr-value"
|
||||
:style="{color:levelList[curIndex]['level_text_color']}">
|
||||
再获得{{ levelList[curIndex + 1].needGrowth > 0 ? levelList[curIndex + 1].needGrowth : 0 }}成长值成为{{
|
||||
levelList[curIndex + 1].level_name
|
||||
}}
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="residue-growr-value" :style="{color:levelList[curIndex]['level_text_color']}">{{ $lang("member.level.l72") }}</view>
|
||||
</block>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-progress :progress="levelList[curIndex].rate" v-if="levelList[curIndex].needGrowth > 0"></ns-progress>
|
||||
<view class="residue-growr-value" v-if="levelList[curIndex].needGrowth > 0" :style="{color:levelList[curIndex]['level_text_color']}">
|
||||
再获得{{ levelList[curIndex].needGrowth }}成长值成为{{ levelList[curIndex].level_name }}
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
<view class="member-equity" v-if="levelList[curIndex].is_free_shipping > 0 || levelList[curIndex].consume_discount > 0 || levelList[curIndex].point_feedback > 0">
|
||||
<view class="equity-title">{{ $lang("member.card.l42") }}</view>
|
||||
<view class="equity-itme" v-if="levelList[curIndex].is_free_shipping > 0">
|
||||
<image :src="$util.img('public/uniapp/level/exemption_postage.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="equity-content" :class="{ active: levelList[curIndex].consume_discount > 0 }">
|
||||
<text>{{ $lang("member.level.l91") }}</text>
|
||||
<text class="equity-desc">{{ $lang("member.level.l92") }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="equity-itme" v-if="levelList[curIndex].consume_discount > 0">
|
||||
<image :src="$util.img('public/uniapp/level/consumption_discount.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="equity-content" :class="{ active: levelList[curIndex].point_feedback > 0 }">
|
||||
<text>{{ $lang("member.level.l98") }}</text>
|
||||
<text class="equity-desc" v-if="levelList[curIndex].is_default == 1">{{ $lang("member.level.l99") }}</text>
|
||||
<text class="equity-desc" v-else>{ $lang("member.level.l100") } levelList[curIndex].consume_discount }}折消费折扣</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="equity-itme" v-if="levelList[curIndex].point_feedback > 0">
|
||||
<image :src="$util.img('public/uniapp/level/integral_feedback.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="equity-content">
|
||||
<text>{{ $lang("member.level.l106") }}</text>
|
||||
<text class="equity-desc">{ $lang("member.level.l100") } levelList[curIndex].point_feedback }}倍积分回馈倍率</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="member-gift" v-if="levelList[curIndex].send_balance > 0 || levelList[curIndex].send_balance > 0 || levelList[curIndex].send_coupon">
|
||||
<view class="gift-title">{{ $lang("member.level.l113") }}</view>
|
||||
<view class="gift-itme" v-if="levelList[curIndex].send_point > 0">
|
||||
<image :src="$util.img('public/uniapp/level/integral.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="gift-content" :class="{ active: levelList[curIndex].send_balance > 0 }">
|
||||
<text>{{ $lang("member.card.l81") }}</text>
|
||||
<text class="gift-desc">{ $lang("member.card.l82") } levelList[curIndex].send_point }}积分</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="gift-itme" v-if="levelList[curIndex].send_balance > 0">
|
||||
<image :src="$util.img('public/uniapp/level/red_packet.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="gift-content" :class="{ active: levelList[curIndex].send_coupon }">
|
||||
<text>{{ $lang("member.card.l86") }}</text>
|
||||
<text class="gift-desc">{ $lang("member.card.l82") } levelList[curIndex].send_balance }}元红包</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="gift-itme" v-if="levelList[curIndex].send_coupon" @click="openCoupon(levelList[curIndex].send_coupon)">
|
||||
<image :src="$util.img('public/uniapp/level/coupon.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<view class="gift-content">
|
||||
<text>{{ $lang("member.card.l91") }}</text>
|
||||
<text class="gift-desc">{ $lang("member.card.l82") } levelList[curIndex].coupon_length }}张优惠券</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 优惠券 -->
|
||||
<uni-popup ref="couponPopup" type="bottom">
|
||||
<view class="coupon-popup-box">
|
||||
<view class="coupon-popup-title" @click="closeCoupon">
|
||||
优惠券
|
||||
<text class="iconfont icon-close"></text>
|
||||
</view>
|
||||
<scroll-view class="coupon-popup-content" scroll-y>
|
||||
<view class="coupon-item" v-for="(item, index) in couponPopList" :key="index">
|
||||
<view class="coupon-name">
|
||||
<text class="name">{{ item.coupon_name }}</text>
|
||||
<text class="desc"></text>
|
||||
</view>
|
||||
<view class="coupon-price" v-if="item.type == 'reward'">
|
||||
<text>{{ item.money }}</text>
|
||||
元
|
||||
</view>
|
||||
<view class="coupon-price" v-if="item.type == 'discount'">
|
||||
<text>{{ $util.numberFixed(item.discount, 1) }}</text>
|
||||
折
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
|
||||
<to-top v-if="showTop" @toTop="scrollToTopNative()"></to-top>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import scroll from '@/common/js/scroll-view.js';
|
||||
|
||||
export default {
|
||||
mixins: [scroll],
|
||||
data() {
|
||||
return {
|
||||
couponPopList: [],
|
||||
curIndex: 0,
|
||||
descIndex: 0,
|
||||
isDescAnimating: false,
|
||||
scaleX: (634 / 540).toFixed(4),
|
||||
scaleY: (378 / 330).toFixed(4),
|
||||
swiperConfig: {
|
||||
indicatorDots: false,
|
||||
indicatorColor: 'rgba(255, 255, 255, .4)',
|
||||
indicatorActiveColor: 'rgba(255, 255, 255, 1)',
|
||||
interval: 3000,
|
||||
duration: 300,
|
||||
circular: false,
|
||||
previousMargin: '58rpx',
|
||||
nextMargin: '58rpx'
|
||||
},
|
||||
levelList: [{
|
||||
needGrowth: 0,
|
||||
growth: 0
|
||||
}],
|
||||
levelId: 0,
|
||||
growth: 0,
|
||||
|
||||
nowIndex: 0, //我当前所在等级的index
|
||||
rule: [] //成长值规则
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
listLen() {
|
||||
return this.levelList.length;
|
||||
},
|
||||
remark() {
|
||||
if (this.levelList[this.curIndex]) {
|
||||
return this.levelList[this.curIndex].remark;
|
||||
}
|
||||
},
|
||||
nextIndex() {
|
||||
let num = 0;
|
||||
if (this.curIndex == this.levelList.length - 1) {
|
||||
return this.curIndex;
|
||||
} else {
|
||||
return this.curIndex + 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
this.getLevelRule();
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/level');
|
||||
});
|
||||
} else {
|
||||
this.getLevelList();
|
||||
}
|
||||
// #ifdef MP-ALIPAY
|
||||
this.scaleX = 1
|
||||
this.scaleY = 1
|
||||
// #endif
|
||||
},
|
||||
onShow() {
|
||||
},
|
||||
filters: {
|
||||
rate(index, list, growth) {
|
||||
let nowGrowth = Number(growth);
|
||||
let minGrouth = Number(list[index].growth);
|
||||
if (index == list.length - 1) {
|
||||
return nowGrowth > minGrouth ? 100 : 0;
|
||||
} else {
|
||||
let maxGrouth = Number(list[index + 1].growth);
|
||||
let num2 = nowGrowth - minGrouth;
|
||||
let num1 = maxGrouth - minGrouth;
|
||||
let num = Math.floor((num2 / num1) * 100);
|
||||
return num > 100 ? 100 : num;
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
swiperChange(e) {
|
||||
let that = this;
|
||||
this.curIndex = e.detail.current;
|
||||
this.isDescAnimating = true;
|
||||
let timer = setTimeout(function() {
|
||||
that.descIndex = e.detail.current;
|
||||
clearTimeout(timer);
|
||||
}, 150);
|
||||
},
|
||||
animationfinish(e) {
|
||||
this.isDescAnimating = false;
|
||||
},
|
||||
getBannerDetail(index) {
|
||||
uni.showLoading({
|
||||
title: $lang('member.level.l268'),
|
||||
duration: 2000,
|
||||
mask: true
|
||||
});
|
||||
},
|
||||
getLevelList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberlevel/lists',
|
||||
success: res => {
|
||||
if (res.data && res.code == 0) {
|
||||
this.levelList = res.data;
|
||||
for (var i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].send_coupon) {
|
||||
this.levelList[i].coupon_length = this.levelList[i].send_coupon.split(',')
|
||||
.length;
|
||||
}
|
||||
}
|
||||
this.levelId = this.memberInfo.member_level;
|
||||
this.growth = this.memberInfo.growth;
|
||||
for (let i = 0; i < this.levelList.length; i++) {
|
||||
if (this.levelList[i].level_id == this.levelId) {
|
||||
this.curIndex = i;
|
||||
this.descIndex = i;
|
||||
this.nowIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.levelList.forEach((v, i) => {
|
||||
if (parseFloat(v.growth) < parseFloat(this.growth)) {
|
||||
v.needGrowth = 0;
|
||||
v.rate = 100;
|
||||
} else {
|
||||
v.needGrowth = (parseFloat(v.growth) - parseFloat(this.growth))
|
||||
.toFixed(2);
|
||||
v.rate = (this.growth / v.growth).toFixed(2) * 100;
|
||||
}
|
||||
});
|
||||
|
||||
this.levelList.forEach(v => {
|
||||
if (v.consume_discount) {
|
||||
v.consume_discount = (v.consume_discount / 10).toFixed(2);
|
||||
}
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
getLevelRule() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/accountrule',
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data && res.data.growth) {
|
||||
this.rule = res.data.growth;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
growthRules() {
|
||||
this.$util.redirectTo('/pages_tool/member/level_growth_rules');
|
||||
},
|
||||
openCoupon(data) {
|
||||
this.couponPopList = [];
|
||||
this.$api.sendRequest({
|
||||
url: '/coupon/api/coupon/couponbyid',
|
||||
data: {
|
||||
id: data
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.couponPopList = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
this.$refs.couponPopup.open();
|
||||
},
|
||||
closeCoupon() {
|
||||
this.$refs.couponPopup.close();
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
return true;
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getLevelList();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/level.scss';
|
||||
</style>
|
||||
@@ -8,8 +8,8 @@
|
||||
</view>
|
||||
<view class="explain-table">
|
||||
<view class="explain-tr">
|
||||
<text class="explain-th">等级</text>
|
||||
<text class="explain-th">成长值</text>
|
||||
<text class="explain-th">{{ $lang("fenxiao.level.l221") }}</text>
|
||||
<text class="explain-th">{{ $lang("common.register-reward.l27.t0") }}</text>
|
||||
</view>
|
||||
<view class="explain-tr" v-for="(item, index) in levelList" :key="index">
|
||||
<text class="explain-td">{{ item.level_name }}</text>
|
||||
@@ -20,20 +20,20 @@
|
||||
<view class="grow-value">
|
||||
<view class="title">
|
||||
<image :src="$util.img('public/uniapp/level/explain.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<text>什么是成长值</text>
|
||||
<text>{{ $lang("member.level_growth_rules.l23") }}</text>
|
||||
</view>
|
||||
<view class="content color-tip">成长值是消费者在店铺成为会员后,通过消费计算出来的值。成长值决定会员等级,会员等级越高,所享受的会员权益和会员礼包就越多。</view>
|
||||
<view class="content color-tip">{{ $lang("member.level_growth_rules.l25") }}</view>
|
||||
</view>
|
||||
<view class="acquisition-grow">
|
||||
<view class="title">
|
||||
<image :src="$util.img('public/uniapp/level/explain.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
<text>如何获得成长值</text>
|
||||
<text>{{ $lang("member.level_growth_rules.l30") }}</text>
|
||||
</view>
|
||||
<view class="content color-tip">
|
||||
<text>1、注册会员送x成长值。</text>
|
||||
<text>2、会员充值到余额送x成长值。</text>
|
||||
<text>3、会员签到送x成长值。</text>
|
||||
<text>4、会员消费x元,交易完成即可获得x个成长值。</text>
|
||||
<text>{{ $lang("member.level_growth_rules.l33") }}</text>
|
||||
<text>{{ $lang("member.level_growth_rules.l34") }}</text>
|
||||
<text>{{ $lang("member.level_growth_rules.l35") }}</text>
|
||||
<text>{{ $lang("member.level_growth_rules.l36") }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -118,7 +118,7 @@
|
||||
},
|
||||
getBannerDetail(index) {
|
||||
uni.showLoading({
|
||||
title: '将前往详情页面',
|
||||
title: $lang('member.level.l268'),
|
||||
duration: 2000,
|
||||
mask: true
|
||||
});
|
||||
|
||||
@@ -1,197 +1,197 @@
|
||||
<template>
|
||||
<view :style="themeColor" class="nc-modify-content">
|
||||
<view class="modify">
|
||||
<view>
|
||||
<image v-if="newImg == ''" :src="memberImg ? $util.img(memberImg) : $util.getDefaultImage().head"
|
||||
@error="memberImg = $util.getDefaultImage().head" mode="aspectFill" show-menu-by-longpress/>
|
||||
<image v-else :src="$util.img(newImg)" @error="newImg = $util.getDefaultImage().head"
|
||||
mode="aspectFill" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="opection-box">
|
||||
<block v-if="newImg == ''">
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<button type="primary" @click="uploadFace()">点击上传</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<button type="primary" @click="chooseImage()">点击上传</button>
|
||||
<!-- #endif -->
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="opec">
|
||||
<button size="mini" class="mini" type="primary" @click="save()">确认保存</button>
|
||||
<button size="mini" class="mini" type="primary" @click="chooseImage()">重新上传</button>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<img-cropping selWidth="300" selHeight="300" @upload="myUpload" ref="imgCropping"></img-cropping>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import imgCropping from '../_components/img-cropping/img-cropping.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
imgCropping,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
memberImg: '',
|
||||
newImg: '',
|
||||
imgurl: ''
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(
|
||||
this.$util.LOGIN_PAGE_URL, {
|
||||
back: '/pages_tool/member/modify_face'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
this.memberImg = this.memberInfo.headimg;
|
||||
this.imgurl = this.memberInfo.headimg;
|
||||
},
|
||||
methods: {
|
||||
chooseImage() {
|
||||
this.$refs.imgCropping.fSelect();
|
||||
},
|
||||
//上传返回图片
|
||||
myUpload(rsp) {
|
||||
let app_type = 'h5';
|
||||
let app_type_name = 'H5';
|
||||
|
||||
// #ifdef MP
|
||||
app_type = 'weapp';
|
||||
app_type_name = 'weapp';
|
||||
// #endif
|
||||
uni.request({
|
||||
url: this.$config.baseUrl + '/api/upload/headimgBase64',
|
||||
method: 'POST',
|
||||
data: {
|
||||
app_type: app_type,
|
||||
app_type_name: app_type_name,
|
||||
images: rsp.base64
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded;application/json'
|
||||
},
|
||||
dataType: 'json',
|
||||
responseType: 'text',
|
||||
success: res => {
|
||||
if (res.data.code == 0) {
|
||||
this.newImg = res.data.data.pic_path;
|
||||
this.imgurl = res.data.data.pic_path;
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: '头像上传失败'
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
previewImage() {
|
||||
uni.previewImage({
|
||||
current: 0,
|
||||
urls: this.images
|
||||
});
|
||||
},
|
||||
save() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/modifyheadimg',
|
||||
data: {
|
||||
headimg: this.imgurl
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.memberInfo.headimg = this.imgurl;
|
||||
this.$store.commit('setMemberInfo', this.memberInfo);
|
||||
this.$util.showToast({
|
||||
title: '头像修改成功'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_tool/member/info', {}, 'redirectTo');
|
||||
}, 2000);
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
uploadFace() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['compressed'],
|
||||
success: (chooseImageRes) => {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
this.$api.upload({
|
||||
url: '/api/upload/headimg',
|
||||
filePath: tempFilePaths[0],
|
||||
fileType: 'image',
|
||||
success: (res) => {
|
||||
if (res.code) {
|
||||
this.newImg = res.data.pic_path;
|
||||
this.imgurl = res.data.pic_path;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.modify {
|
||||
position: relative;
|
||||
padding-top: 50rpx;
|
||||
|
||||
view {
|
||||
width: 500rpx;
|
||||
height: 500rpx;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
background-color: #ffffff;
|
||||
border: 4rpx solid #ffffff;
|
||||
border-radius: 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.opection-box {
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
|
||||
.opec {
|
||||
width: 100%;
|
||||
padding: 0 10%;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
button {
|
||||
padding: 0 30rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor" class="nc-modify-content">
|
||||
<view class="modify">
|
||||
<view>
|
||||
<image v-if="newImg == ''" :src="memberImg ? $util.img(memberImg) : $util.getDefaultImage().head"
|
||||
@error="memberImg = $util.getDefaultImage().head" mode="aspectFill" show-menu-by-longpress/>
|
||||
<image v-else :src="$util.img(newImg)" @error="newImg = $util.getDefaultImage().head"
|
||||
mode="aspectFill" show-menu-by-longpress/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="opection-box">
|
||||
<block v-if="newImg == ''">
|
||||
<!-- #ifdef MP-ALIPAY -->
|
||||
<button type="primary" @click="uploadFace()">{{ $lang("member.modify_face.l14") }}</button>
|
||||
<!-- #endif -->
|
||||
<!-- #ifndef MP-ALIPAY -->
|
||||
<button type="primary" @click="chooseImage()">{{ $lang("member.modify_face.l14") }}</button>
|
||||
<!-- #endif -->
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="opec">
|
||||
<button size="mini" class="mini" type="primary" @click="save()">{{ $lang("member.modify_face.l22") }}</button>
|
||||
<button size="mini" class="mini" type="primary" @click="chooseImage()">{{ $lang("member.modify_face.l23") }}</button>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<img-cropping selWidth="300" selHeight="300" @upload="myUpload" ref="imgCropping"></img-cropping>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import imgCropping from '../_components/img-cropping/img-cropping.vue';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
imgCropping,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
memberImg: '',
|
||||
newImg: '',
|
||||
imgurl: ''
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(
|
||||
this.$util.LOGIN_PAGE_URL, {
|
||||
back: '/pages_tool/member/modify_face'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
this.memberImg = this.memberInfo.headimg;
|
||||
this.imgurl = this.memberInfo.headimg;
|
||||
},
|
||||
methods: {
|
||||
chooseImage() {
|
||||
this.$refs.imgCropping.fSelect();
|
||||
},
|
||||
//上传返回图片
|
||||
myUpload(rsp) {
|
||||
let app_type = 'h5';
|
||||
let app_type_name = 'H5';
|
||||
|
||||
// #ifdef MP
|
||||
app_type = 'weapp';
|
||||
app_type_name = 'weapp';
|
||||
// #endif
|
||||
uni.request({
|
||||
url: this.$config.baseUrl + '/api/upload/headimgBase64',
|
||||
method: 'POST',
|
||||
data: {
|
||||
app_type: app_type,
|
||||
app_type_name: app_type_name,
|
||||
images: rsp.base64
|
||||
},
|
||||
header: {
|
||||
'content-type': 'application/x-www-form-urlencoded;application/json'
|
||||
},
|
||||
dataType: 'json',
|
||||
responseType: 'text',
|
||||
success: res => {
|
||||
if (res.data.code == 0) {
|
||||
this.newImg = res.data.data.pic_path;
|
||||
this.imgurl = res.data.data.pic_path;
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.modify_face.l95')
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
previewImage() {
|
||||
uni.previewImage({
|
||||
current: 0,
|
||||
urls: this.images
|
||||
});
|
||||
},
|
||||
save() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/modifyheadimg',
|
||||
data: {
|
||||
headimg: this.imgurl
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.memberInfo.headimg = this.imgurl;
|
||||
this.$store.commit('setMemberInfo', this.memberInfo);
|
||||
this.$util.showToast({
|
||||
title: $lang('member.modify_face.l117')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_tool/member/info', {}, 'redirectTo');
|
||||
}, 2000);
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
uploadFace() {
|
||||
uni.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ['compressed'],
|
||||
success: (chooseImageRes) => {
|
||||
const tempFilePaths = chooseImageRes.tempFilePaths;
|
||||
this.$api.upload({
|
||||
url: '/api/upload/headimg',
|
||||
filePath: tempFilePaths[0],
|
||||
fileType: 'image',
|
||||
success: (res) => {
|
||||
if (res.code) {
|
||||
this.newImg = res.data.pic_path;
|
||||
this.imgurl = res.data.pic_path;
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
page {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.modify {
|
||||
position: relative;
|
||||
padding-top: 50rpx;
|
||||
|
||||
view {
|
||||
width: 500rpx;
|
||||
height: 500rpx;
|
||||
margin: 0 auto;
|
||||
overflow: hidden;
|
||||
background-color: #ffffff;
|
||||
border: 4rpx solid #ffffff;
|
||||
border-radius: 100%;
|
||||
|
||||
image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.opection-box {
|
||||
margin-top: 50rpx;
|
||||
}
|
||||
|
||||
.opec {
|
||||
width: 100%;
|
||||
padding: 0 10%;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
|
||||
button {
|
||||
padding: 0 30rpx;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,278 +1,278 @@
|
||||
<template>
|
||||
<view :style="themeColor" class="container">
|
||||
<view class="tips" v-if="step != 0">请输入6位支付密码,建议不要使用重复或连续数字</view>
|
||||
<view class="tips" v-else>验证码已发送至{{ memberInfo.mobile | mobile }}请在下方输入4位数字验证码</view>
|
||||
<view class="password-wrap">
|
||||
<myp-one :maxlength="step == 0 ? 4 : 6" :is-pwd="step != 0" @input="input" ref="input" :auto-focus="true"></myp-one>
|
||||
<view v-show="step == 0" class="dynacode" :class="dynacodeData.seconds == 120 ? 'color-base-text' : 'color-tip'" @click="sendMobileCode">
|
||||
{{ dynacodeData.codeText }}
|
||||
</view>
|
||||
<view class="action-tips" v-show="step == 0">输入短信验证码</view>
|
||||
<view class="action-tips" v-show="step == 1">请设置支付密码</view>
|
||||
<view class="action-tips" v-show="step == 2">请再次输入</view>
|
||||
<view class="btn color-base-bg color-base-border" :class="{ disabled: !isClick }" @click="confirm">确认</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mypOne from '../_components/myp-one/myp-one.vue';
|
||||
export default {
|
||||
components: {
|
||||
mypOne
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isClick: false,
|
||||
step: 1,
|
||||
key: '', // 短信key
|
||||
code: '', // 动态码
|
||||
password: '', // 密码
|
||||
repassword: '', // 重复密码
|
||||
isSub: false, // 防重复提交
|
||||
back: '', // 返回页
|
||||
dynacodeData: {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: '获取验证码',
|
||||
isSend: false
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
if (this.memberInfo.mobile == '') {
|
||||
uni.showModal({
|
||||
title: '提示',
|
||||
content: '设置支付密码需要先绑定手机号,是否立即绑定?',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$util.redirectTo('/pages_tool/member/info', {
|
||||
action: 'mobile',
|
||||
back: this.back
|
||||
}, 'redirectTo');
|
||||
} else {
|
||||
if (this.back) this.$util.redirectTo(this.back);
|
||||
else this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.step = 0;
|
||||
this.sendMobileCode();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
input(val) {
|
||||
if (this.step == 0) {
|
||||
if (val.length == 4) {
|
||||
this.isClick = true;
|
||||
this.code = val;
|
||||
} else {
|
||||
this.isClick = false;
|
||||
}
|
||||
} else if (this.step == 1) {
|
||||
if (val.length == 6) {
|
||||
this.isClick = true;
|
||||
this.password = val;
|
||||
} else {
|
||||
this.isClick = false;
|
||||
}
|
||||
} else {
|
||||
if (val.length == 6) {
|
||||
this.isClick = true;
|
||||
this.repassword = val;
|
||||
} else {
|
||||
this.isClick = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
if (this.isClick) {
|
||||
if (this.step == 0) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/verifypaypwdcode',
|
||||
data: {
|
||||
code: this.code,
|
||||
key: this.key
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$refs.input.clear();
|
||||
this.isClick = false;
|
||||
this.step = 1;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (this.step == 1) {
|
||||
this.$refs.input.clear();
|
||||
this.isClick = false;
|
||||
this.step = 2;
|
||||
} else {
|
||||
if (this.password == this.repassword) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/modifypaypassword',
|
||||
data: {
|
||||
key: this.key,
|
||||
code: this.code,
|
||||
password: this.password
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: '修改成功'
|
||||
});
|
||||
setTimeout(() => {
|
||||
if (this.back) this.$util.redirectTo(this.back, {},
|
||||
'redirectTo');
|
||||
else this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}, 2000);
|
||||
} else {
|
||||
this.initInfo();
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '两次输入的密码不一致',
|
||||
success: res => {
|
||||
this.initInfo();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
initInfo() {
|
||||
this.isClick = false;
|
||||
this.step = 1;
|
||||
this.password = '';
|
||||
this.repassword = '';
|
||||
this.oldpassword = '';
|
||||
this.isSub = false;
|
||||
this.$refs.input.clear();
|
||||
},
|
||||
/**
|
||||
* 发送手机动态码
|
||||
*/
|
||||
sendMobileCode() {
|
||||
if (this.dynacodeData.seconds != 120) return;
|
||||
if (this.dynacodeData.isSend) return;
|
||||
this.dynacodeData.isSend = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/paypwdcode',
|
||||
success: res => {
|
||||
this.dynacodeData.isSend = false;
|
||||
if (res.code >= 0) {
|
||||
this.key = res.data.key;
|
||||
|
||||
if (this.dynacodeData.seconds == 120 && this.dynacodeData.timer == null) {
|
||||
this.dynacodeData.timer = setInterval(() => {
|
||||
this.dynacodeData.seconds--;
|
||||
this.dynacodeData.codeText = this.dynacodeData.seconds + 's后可重新获取';
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: 'request:fail'
|
||||
});
|
||||
this.dynacodeData.isSend = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
mobile(mobile) {
|
||||
return mobile.substring(0, 4 - 1) + '****' + mobile.substring(6 + 1);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'dynacodeData.seconds': {
|
||||
handler(newValue, oldValue) {
|
||||
if (newValue == 0) {
|
||||
clearInterval(this.dynacodeData.timer);
|
||||
this.dynacodeData = {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: '获取动态码',
|
||||
isSend: false
|
||||
};
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
|
||||
.tips {
|
||||
width: 60%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
padding-top: 100rpx;
|
||||
}
|
||||
|
||||
.password-wrap {
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.action-tips {
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.dynacode {
|
||||
line-height: 1;
|
||||
margin-top: 20rpx;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 0 auto;
|
||||
margin-top: 30rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: $border-radius;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
|
||||
&.disabled {
|
||||
background: #ccc !important;
|
||||
border-color: #ccc !important;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor" class="container">
|
||||
<view class="tips" v-if="step != 0">{{ $lang("member.pay_password.l3") }}</view>
|
||||
<view class="tips" v-else>{ $lang("member.pay_password.l4") } memberInfo.mobile | mobile }}请在下方输入4位数字验证码</view>
|
||||
<view class="password-wrap">
|
||||
<myp-one :maxlength="step == 0 ? 4 : 6" :is-pwd="step != 0" @input="input" ref="input" :auto-focus="true"></myp-one>
|
||||
<view v-show="step == 0" class="dynacode" :class="dynacodeData.seconds == 120 ? 'color-base-text' : 'color-tip'" @click="sendMobileCode">
|
||||
{{ dynacodeData.codeText }}
|
||||
</view>
|
||||
<view class="action-tips" v-show="step == 0">{{ $lang("member.pay_password.l10") }}</view>
|
||||
<view class="action-tips" v-show="step == 1">{{ $lang("member.pay_password.l11") }}</view>
|
||||
<view class="action-tips" v-show="step == 2">{{ $lang("member.pay_password.l12") }}</view>
|
||||
<view class="btn color-base-bg color-base-border" :class="{ disabled: !isClick }" @click="confirm">{{ $lang("common.ns-goods-sku.l196.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import mypOne from '../_components/myp-one/myp-one.vue';
|
||||
export default {
|
||||
components: {
|
||||
mypOne
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isClick: false,
|
||||
step: 1,
|
||||
key: '', // 短信key
|
||||
code: '', // 动态码
|
||||
password: '', // 密码
|
||||
repassword: '', // 重复密码
|
||||
isSub: false, // 防重复提交
|
||||
back: '', // 返回页
|
||||
dynacodeData: {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: $lang('member.pay_password.l37'),
|
||||
isSend: false
|
||||
}
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.back) this.back = option.back;
|
||||
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
if (this.memberInfo.mobile == '') {
|
||||
uni.showModal({
|
||||
title: $lang('common.wxwork-contact.l202.t0'),
|
||||
content: $lang('member.pay_password.l52'),
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$util.redirectTo('/pages_tool/member/info', {
|
||||
action: 'mobile',
|
||||
back: this.back
|
||||
}, 'redirectTo');
|
||||
} else {
|
||||
if (this.back) this.$util.redirectTo(this.back);
|
||||
else this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.step = 0;
|
||||
this.sendMobileCode();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
input(val) {
|
||||
if (this.step == 0) {
|
||||
if (val.length == 4) {
|
||||
this.isClick = true;
|
||||
this.code = val;
|
||||
} else {
|
||||
this.isClick = false;
|
||||
}
|
||||
} else if (this.step == 1) {
|
||||
if (val.length == 6) {
|
||||
this.isClick = true;
|
||||
this.password = val;
|
||||
} else {
|
||||
this.isClick = false;
|
||||
}
|
||||
} else {
|
||||
if (val.length == 6) {
|
||||
this.isClick = true;
|
||||
this.repassword = val;
|
||||
} else {
|
||||
this.isClick = false;
|
||||
}
|
||||
}
|
||||
},
|
||||
confirm() {
|
||||
if (this.isClick) {
|
||||
if (this.step == 0) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/verifypaypwdcode',
|
||||
data: {
|
||||
code: this.code,
|
||||
key: this.key
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$refs.input.clear();
|
||||
this.isClick = false;
|
||||
this.step = 1;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (this.step == 1) {
|
||||
this.$refs.input.clear();
|
||||
this.isClick = false;
|
||||
this.step = 2;
|
||||
} else {
|
||||
if (this.password == this.repassword) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/modifypaypassword',
|
||||
data: {
|
||||
key: this.key,
|
||||
code: this.code,
|
||||
password: this.password
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.account_edit.l230')
|
||||
});
|
||||
setTimeout(() => {
|
||||
if (this.back) this.$util.redirectTo(this.back, {},
|
||||
'redirectTo');
|
||||
else this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}, 2000);
|
||||
} else {
|
||||
this.initInfo();
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.pay_password.l152'),
|
||||
success: res => {
|
||||
this.initInfo();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
initInfo() {
|
||||
this.isClick = false;
|
||||
this.step = 1;
|
||||
this.password = '';
|
||||
this.repassword = '';
|
||||
this.oldpassword = '';
|
||||
this.isSub = false;
|
||||
this.$refs.input.clear();
|
||||
},
|
||||
/**
|
||||
* 发送手机动态码
|
||||
*/
|
||||
sendMobileCode() {
|
||||
if (this.dynacodeData.seconds != 120) return;
|
||||
if (this.dynacodeData.isSend) return;
|
||||
this.dynacodeData.isSend = true;
|
||||
|
||||
this.$api.sendRequest({
|
||||
url: '/api/member/paypwdcode',
|
||||
success: res => {
|
||||
this.dynacodeData.isSend = false;
|
||||
if (res.code >= 0) {
|
||||
this.key = res.data.key;
|
||||
|
||||
if (this.dynacodeData.seconds == 120 && this.dynacodeData.timer == null) {
|
||||
this.dynacodeData.timer = setInterval(() => {
|
||||
this.dynacodeData.seconds--;
|
||||
this.dynacodeData.codeText = this.dynacodeData.seconds + $lang('common.ns-login.l414.t0');
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: 'request:fail'
|
||||
});
|
||||
this.dynacodeData.isSend = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
mobile(mobile) {
|
||||
return mobile.substring(0, 4 - 1) + '****' + mobile.substring(6 + 1);
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
'dynacodeData.seconds': {
|
||||
handler(newValue, oldValue) {
|
||||
if (newValue == 0) {
|
||||
clearInterval(this.dynacodeData.timer);
|
||||
this.dynacodeData = {
|
||||
seconds: 120,
|
||||
timer: null,
|
||||
codeText: $lang('common.ns-login.l169.t0'),
|
||||
isSend: false
|
||||
};
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
deep: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
background: #fff;
|
||||
|
||||
.tips {
|
||||
width: 60%;
|
||||
margin: 0 auto;
|
||||
text-align: center;
|
||||
padding-top: 100rpx;
|
||||
}
|
||||
|
||||
.password-wrap {
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
margin-top: 40rpx;
|
||||
|
||||
.action-tips {
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
margin-top: 80rpx;
|
||||
}
|
||||
|
||||
.dynacode {
|
||||
line-height: 1;
|
||||
margin-top: 20rpx;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
|
||||
.btn {
|
||||
margin: 0 auto;
|
||||
margin-top: 30rpx;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-radius: $border-radius;
|
||||
color: #fff;
|
||||
text-align: center;
|
||||
|
||||
&.disabled {
|
||||
background: #ccc !important;
|
||||
border-color: #ccc !important;
|
||||
color: #fff;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,161 +1,161 @@
|
||||
<template>
|
||||
<view :style="themeColor" class="point">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="custom-navbar" :style="{
|
||||
'padding-top': menuButtonBounding.top + 'px',
|
||||
'height': menuButtonBounding.height + 'px'
|
||||
}"
|
||||
>
|
||||
<view class="navbar-wrap">
|
||||
<text class="iconfont icon-back_light back" @click="$util.redirectTo($util.MEMBER_PAGE_URL)"></text>
|
||||
<view class="navbar-title">
|
||||
我的积分
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="head-wrap" :style="{ background: 'url(' + $util.img('public/uniapp/point/point_bg.png') + ') no-repeat right bottom/ auto 340rpx, linear-gradient(314deg, #F16914 0%, #FEAA4C 100%)' }">
|
||||
<view class="point price-font">{{ pointInfo.point }}</view>
|
||||
<view class="title">当前积分</view>
|
||||
<view class="flex-box">
|
||||
<view class="flex-item">
|
||||
<view class="num price-font">{{ pointInfo.totalPoint }}</view>
|
||||
<view class="font-size-tag">累计积分</view>
|
||||
</view>
|
||||
<view class="flex-item">
|
||||
<view class="num price-font">{{ pointInfo.totalConsumePoint }}</view>
|
||||
<view class="font-size-tag">累计消费</view>
|
||||
</view>
|
||||
<view class="flex-item">
|
||||
<view class="num price-font">{{ pointInfo.todayPoint }}</view>
|
||||
<view class="font-size-tag">今日获得</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="menu-wrap">
|
||||
<view class="menu-item" @click="$util.redirectTo('/pages_tool/member/point_detail')">
|
||||
<view class="icon">
|
||||
<image :src="$util.img('public/uniapp/point/point_detail_icon.png')" mode="widthFix"></image>
|
||||
</view>
|
||||
<text class="title">积分明细</text>
|
||||
</view>
|
||||
<view class="menu-item" @click="$util.redirectTo('/pages_promotion/point/list')">
|
||||
<view class="icon">
|
||||
<image :src="$util.img('public/uniapp/point/point_shop.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<text class="title">积分商城</text>
|
||||
</view>
|
||||
</view>
|
||||
<!--
|
||||
<view class="task-wrap">
|
||||
<view class="title">做任务赚积分</view>
|
||||
<view class="task-item" @click="toSign">
|
||||
<view class="icon"><text class="iconfont icon-qiandao1"></text></view>
|
||||
<view class="wrap">
|
||||
<view class="title">每日签到</view>
|
||||
<view class="desc color-tip font-size-tag">连续签到可获得更多积分</view>
|
||||
</view>
|
||||
<view class="btn">去签到</view>
|
||||
</view>
|
||||
<view class="task-item" @click="$util.redirectTo('/pages/index/index')">
|
||||
<view class="icon"><text class="iconfont icon-shangpin"></text></view>
|
||||
<view class="wrap">
|
||||
<view class="title">购买商品</view>
|
||||
<view class="desc color-tip font-size-tag">购买商品可获得积分</view>
|
||||
</view>
|
||||
<view class="btn">去下单</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pointInfo: {
|
||||
point: 0,
|
||||
totalPoint: 0,
|
||||
totalConsumePoint: 0,
|
||||
todayPoint: 0
|
||||
},
|
||||
menuButtonBounding: {} // 小程序胶囊属性
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/point');
|
||||
});
|
||||
} else {
|
||||
this.getMemberPoint();
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef MP
|
||||
this.menuButtonBounding = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
toSign() {
|
||||
this.$util.redirectTo('/pages_tool/member/signin');
|
||||
},
|
||||
getMemberPoint() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/point',
|
||||
data: {
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.pointInfo.point = parseInt(res.data.point);
|
||||
this.pointInfo.totalPoint = parseInt(res.data.point_all);
|
||||
this.pointInfo.totalConsumePoint = parseInt(res.data.point_use);
|
||||
this.pointInfo.todayPoint = parseInt(res.data.point_today);
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取充值提现配置
|
||||
*/
|
||||
getMemberrechargeConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecharge/api/memberrecharge/config',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.memberrechargeConfig = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||
return true;
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getMemberPoint();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/point.scss';
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor" class="point">
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<view class="custom-navbar" :style="{
|
||||
'padding-top': menuButtonBounding.top + 'px',
|
||||
'height': menuButtonBounding.height + 'px'
|
||||
}"
|
||||
>
|
||||
<view class="navbar-wrap">
|
||||
<text class="iconfont icon-back_light back" @click="$util.redirectTo($util.MEMBER_PAGE_URL)"></text>
|
||||
<view class="navbar-title">
|
||||
我的积分
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #endif -->
|
||||
|
||||
<view class="head-wrap" :style="{ background: 'url(' + $util.img('public/uniapp/point/point_bg.png') + ') no-repeat right bottom/ auto 340rpx, linear-gradient(314deg, #F16914 0%, #FEAA4C 100%)' }">
|
||||
<view class="point price-font">{{ pointInfo.point }}</view>
|
||||
<view class="title">{{ $lang("member.point.l20") }}</view>
|
||||
<view class="flex-box">
|
||||
<view class="flex-item">
|
||||
<view class="num price-font">{{ pointInfo.totalPoint }}</view>
|
||||
<view class="font-size-tag">{{ $lang("member.point.l24") }}</view>
|
||||
</view>
|
||||
<view class="flex-item">
|
||||
<view class="num price-font">{{ pointInfo.totalConsumePoint }}</view>
|
||||
<view class="font-size-tag">{{ $lang("member.point.l28") }}</view>
|
||||
</view>
|
||||
<view class="flex-item">
|
||||
<view class="num price-font">{{ pointInfo.todayPoint }}</view>
|
||||
<view class="font-size-tag">{{ $lang("member.point.l32") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="menu-wrap">
|
||||
<view class="menu-item" @click="$util.redirectTo('/pages_tool/member/point_detail')">
|
||||
<view class="icon">
|
||||
<image :src="$util.img('public/uniapp/point/point_detail_icon.png')" mode="widthFix"></image>
|
||||
</view>
|
||||
<text class="title">{{ $lang("point.list.l67") }}</text>
|
||||
</view>
|
||||
<view class="menu-item" @click="$util.redirectTo('/pages_promotion/point/list')">
|
||||
<view class="icon">
|
||||
<image :src="$util.img('public/uniapp/point/point_shop.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<text class="title">{{ $lang("member.point.l48") }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!--
|
||||
<view class="task-wrap">
|
||||
<view class="title">{{ $lang("member.point.l53") }}</view>
|
||||
<view class="task-item" @click="toSign">
|
||||
<view class="icon"><text class="iconfont icon-qiandao1"></text></view>
|
||||
<view class="wrap">
|
||||
<view class="title">{{ $lang("member.point.l57") }}</view>
|
||||
<view class="desc color-tip font-size-tag">{{ $lang("member.point.l58") }}</view>
|
||||
</view>
|
||||
<view class="btn">{{ $lang("member.point.l60") }}</view>
|
||||
</view>
|
||||
<view class="task-item" @click="$util.redirectTo('/pages/index/index')">
|
||||
<view class="icon"><text class="iconfont icon-shangpin"></text></view>
|
||||
<view class="wrap">
|
||||
<view class="title">{{ $lang("member.point.l65") }}</view>
|
||||
<view class="desc color-tip font-size-tag">{{ $lang("member.point.l66") }}</view>
|
||||
</view>
|
||||
<view class="btn">{{ $lang("member.point.l68") }}</view>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<ns-login ref="login"></ns-login>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pointInfo: {
|
||||
point: 0,
|
||||
totalPoint: 0,
|
||||
totalConsumePoint: 0,
|
||||
todayPoint: 0
|
||||
},
|
||||
menuButtonBounding: {} // 小程序胶囊属性
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/point');
|
||||
});
|
||||
} else {
|
||||
this.getMemberPoint();
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// #ifdef MP
|
||||
this.menuButtonBounding = uni.getMenuButtonBoundingClientRect();
|
||||
// #endif
|
||||
},
|
||||
methods: {
|
||||
toSign() {
|
||||
this.$util.redirectTo('/pages_tool/member/signin');
|
||||
},
|
||||
getMemberPoint() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/point',
|
||||
data: {
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.pointInfo.point = parseInt(res.data.point);
|
||||
this.pointInfo.totalPoint = parseInt(res.data.point_all);
|
||||
this.pointInfo.totalConsumePoint = parseInt(res.data.point_use);
|
||||
this.pointInfo.todayPoint = parseInt(res.data.point_today);
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取充值提现配置
|
||||
*/
|
||||
getMemberrechargeConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecharge/api/memberrecharge/config',
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.memberrechargeConfig = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
onBackPress(options) {
|
||||
if (options.from === 'navigateBack') {
|
||||
return false;
|
||||
}
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||
return true;
|
||||
},
|
||||
watch: {
|
||||
storeToken: function(nVal, oVal) {
|
||||
if (nVal) {
|
||||
this.getMemberPoint();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/point.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,342 +1,342 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<!-- <view class="tab color-bg">
|
||||
<view class="tab-left">
|
||||
<picker mode="date" :value="searchType.date" @change="bindDateChange" fields="month">
|
||||
<view class="uni-input">
|
||||
{{ date }}
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="tab-right">
|
||||
<picker @change="bindPickerChange" :value="pointIndex" :range="pointType" class="picker" range-key="label">
|
||||
<text class="desc uni-input">{{ pointType[pointIndex].label }}</text>
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</picker>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<mescroll-uni @getData="getData" class="member-point" ref="mescroll">
|
||||
<view slot="list">
|
||||
<block v-if="dataList.length">
|
||||
<view class="detailed-wrap">
|
||||
<view class="cont">
|
||||
<view class="detailed-item" v-for="(item, index) in dataList" :key="index">
|
||||
<view class="info" @click="toFromDetail(item)">
|
||||
<view class="event">{{ item.type_name }}</view>
|
||||
<view class="time-box">
|
||||
<text class="time color-tip">{{ $util.timeStampTurnTime(item.create_time) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num color-base-text" v-if="item.account_data > 0">+{{ parseInt(item.account_data) }}</view>
|
||||
<view class="num " v-else>{{ parseInt(item.account_data) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cart-empty"><ns-empty></ns-empty></view>
|
||||
</block>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
const currentDate = this.getDate({
|
||||
format: true
|
||||
});
|
||||
return {
|
||||
memberAccount: {
|
||||
point: 0
|
||||
},
|
||||
dataList: [],
|
||||
date: currentDate,
|
||||
searchType: {
|
||||
from_type: 0,
|
||||
date: ''
|
||||
},
|
||||
pointType: [
|
||||
{
|
||||
label: '全部',
|
||||
value: '0'
|
||||
}
|
||||
], //积分类型
|
||||
pointIndex: 0,
|
||||
related_id: 0
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(
|
||||
this.$util.LOGIN_PAGE_URL,
|
||||
{
|
||||
back: '/pages_tool/member/point'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.related_id) this.related_id = option.related_id ? option.related_id : 0;
|
||||
if (option.from_type) this.searchType.from_type = option.from_type;
|
||||
this.getPointType();
|
||||
},
|
||||
methods: {
|
||||
bindDateChange: function(e) {
|
||||
var temp = e.target.value;
|
||||
var tempArr = temp.split('-');
|
||||
this.date = tempArr[0] + '年' + tempArr[1] + '月';
|
||||
this.searchType.date = e.target.value;
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
getDate(type) {
|
||||
const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth() + 1;
|
||||
let day = date.getDate();
|
||||
|
||||
if (type === 'start') {
|
||||
year = year - 60;
|
||||
} else if (type === 'end') {
|
||||
year = year + 2;
|
||||
}
|
||||
month = month > 9 ? month : '0' + month;
|
||||
day = day > 9 ? day : '0' + day;
|
||||
return `${year}年${month}月`;
|
||||
},
|
||||
bindPickerChange(e) {
|
||||
this.pointIndex = e.detail.value;
|
||||
this.searchType.from_type = this.pointType[this.pointIndex].value;
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
//获取分类类型
|
||||
getPointType() {
|
||||
var temp = [],
|
||||
that = this;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/fromType',
|
||||
success: res => {
|
||||
for (var index in res.point) {
|
||||
var obg = {};
|
||||
obg.label = res.point[index].type_name;
|
||||
obg.value = index;
|
||||
that.pointType.push(obg);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
toList() {
|
||||
this.$util.redirectTo('/pages_promotion/point/list');
|
||||
},
|
||||
toOrderList() {
|
||||
this.$util.redirectTo('/pages_promotion/point/order_list');
|
||||
},
|
||||
toFromDetail(item) {
|
||||
if (item.from_type == 'pointexchange') {
|
||||
this.$api.sendRequest({
|
||||
url: '/pointexchange/api/order/info',
|
||||
data: {
|
||||
order_id: item.type_tag
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
var data = res.data;
|
||||
if (data.type == 1 && data.relate_order_id) {
|
||||
switch (data.delivery_type) {
|
||||
case 'store':
|
||||
this.$util.redirectTo('/pages_order/detail_pickup', {
|
||||
order_id: data.relate_order_id
|
||||
});
|
||||
break;
|
||||
case 'local':
|
||||
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
||||
order_id: data.relate_order_id
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: data.relate_order_id
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_order/detail_point', {
|
||||
order_id: data.order_id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (item.from_type == 'pointcash') {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
} else if (item.from_type == 'memberconsume') {
|
||||
// this.$util.redirectTo('/pages_order/detail', {
|
||||
// order_id: item.type_tag
|
||||
// });
|
||||
} else if (item.from_type == 'pointexchangerefund' && parseInt(item.type_tag) != 0) {
|
||||
this.$util.redirectTo('/pages_order/detail_point', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
} else if (item.from_type == 'refund' && parseInt(item.type_tag) != 0) {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
}
|
||||
},
|
||||
//获得列表数据
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num,
|
||||
account_type: 'point',
|
||||
from_type: this.searchType.from_type,
|
||||
date: this.searchType.date,
|
||||
related_id: this.related_id
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) {
|
||||
this.dataList = []; //如果是第一页需手动制空列表
|
||||
this.related_id = 0;
|
||||
}
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.tab {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 80rpx;
|
||||
background-color: $color-bg;
|
||||
|
||||
view {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
|
||||
text {
|
||||
margin-left: 10rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
.tab-left{
|
||||
display: flex;
|
||||
padding-left: 30rpx;
|
||||
}
|
||||
.tab-right{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-right: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cart-empty {
|
||||
margin-top: 208rpx !important;
|
||||
}
|
||||
|
||||
.detailed-wrap {
|
||||
background: #fff;
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
padding-top: 20rpx;
|
||||
|
||||
.head {
|
||||
display: flex;
|
||||
height: 90rpx;
|
||||
|
||||
& > view {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
padding: 0 $padding;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cont {
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
|
||||
.detailed-item {
|
||||
padding: 30rpx 0 32rpx;
|
||||
margin: 0 32rpx;
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-of-type {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.info {
|
||||
padding-right: 180rpx;
|
||||
|
||||
.event {
|
||||
font-size: $font-size-base;
|
||||
line-height: 1.3;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.time-box {
|
||||
line-height: 1;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: $font-size-activity-tag;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
width: 160rpx;
|
||||
position: absolute;
|
||||
right: 17rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
text-align: right;
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<!-- <view class="tab color-bg">
|
||||
<view class="tab-left">
|
||||
<picker mode="date" :value="searchType.date" @change="bindDateChange" fields="month">
|
||||
<view class="uni-input">
|
||||
{{ date }}
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</view>
|
||||
</picker>
|
||||
</view>
|
||||
<view class="tab-right">
|
||||
<picker @change="bindPickerChange" :value="pointIndex" :range="pointType" class="picker" range-key="label">
|
||||
<text class="desc uni-input">{{ pointType[pointIndex].label }}</text>
|
||||
<text class="iconfont icon-iconangledown"></text>
|
||||
</picker>
|
||||
</view>
|
||||
</view> -->
|
||||
|
||||
<mescroll-uni @getData="getData" class="member-point" ref="mescroll">
|
||||
<view slot="list">
|
||||
<block v-if="dataList.length">
|
||||
<view class="detailed-wrap">
|
||||
<view class="cont">
|
||||
<view class="detailed-item" v-for="(item, index) in dataList" :key="index">
|
||||
<view class="info" @click="toFromDetail(item)">
|
||||
<view class="event">{{ item.type_name }}</view>
|
||||
<view class="time-box">
|
||||
<text class="time color-tip">{{ $util.timeStampTurnTime(item.create_time) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="num color-base-text" v-if="item.account_data > 0">+{{ parseInt(item.account_data) }}</view>
|
||||
<view class="num " v-else>{{ parseInt(item.account_data) }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cart-empty"><ns-empty></ns-empty></view>
|
||||
</block>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
const currentDate = this.getDate({
|
||||
format: true
|
||||
});
|
||||
return {
|
||||
memberAccount: {
|
||||
point: 0
|
||||
},
|
||||
dataList: [],
|
||||
date: currentDate,
|
||||
searchType: {
|
||||
from_type: 0,
|
||||
date: ''
|
||||
},
|
||||
pointType: [
|
||||
{
|
||||
label: $lang('diy.diy-category-item.l47.t0'),
|
||||
value: '0'
|
||||
}
|
||||
], //积分类型
|
||||
pointIndex: 0,
|
||||
related_id: 0
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(
|
||||
this.$util.LOGIN_PAGE_URL,
|
||||
{
|
||||
back: '/pages_tool/member/point'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.related_id) this.related_id = option.related_id ? option.related_id : 0;
|
||||
if (option.from_type) this.searchType.from_type = option.from_type;
|
||||
this.getPointType();
|
||||
},
|
||||
methods: {
|
||||
bindDateChange: function(e) {
|
||||
var temp = e.target.value;
|
||||
var tempArr = temp.split('-');
|
||||
this.date = tempArr[0] + $lang('order._components.common-payment.payment.l159.t0') + tempArr[1] + $lang('common.ns-select-time.l96.t0');
|
||||
this.searchType.date = e.target.value;
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
getDate(type) {
|
||||
const date = new Date();
|
||||
let year = date.getFullYear();
|
||||
let month = date.getMonth() + 1;
|
||||
let day = date.getDate();
|
||||
|
||||
if (type === 'start') {
|
||||
year = year - 60;
|
||||
} else if (type === 'end') {
|
||||
year = year + 2;
|
||||
}
|
||||
month = month > 9 ? month : '0' + month;
|
||||
day = day > 9 ? day : '0' + day;
|
||||
return $lang(`member.balance_detail.l124.t0`);
|
||||
},
|
||||
bindPickerChange(e) {
|
||||
this.pointIndex = e.detail.value;
|
||||
this.searchType.from_type = this.pointType[this.pointIndex].value;
|
||||
this.$refs.mescroll.refresh();
|
||||
},
|
||||
//获取分类类型
|
||||
getPointType() {
|
||||
var temp = [],
|
||||
that = this;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/fromType',
|
||||
success: res => {
|
||||
for (var index in res.point) {
|
||||
var obg = {};
|
||||
obg.label = res.point[index].type_name;
|
||||
obg.value = index;
|
||||
that.pointType.push(obg);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
toList() {
|
||||
this.$util.redirectTo('/pages_promotion/point/list');
|
||||
},
|
||||
toOrderList() {
|
||||
this.$util.redirectTo('/pages_promotion/point/order_list');
|
||||
},
|
||||
toFromDetail(item) {
|
||||
if (item.from_type == 'pointexchange') {
|
||||
this.$api.sendRequest({
|
||||
url: '/pointexchange/api/order/info',
|
||||
data: {
|
||||
order_id: item.type_tag
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
var data = res.data;
|
||||
if (data.type == 1 && data.relate_order_id) {
|
||||
switch (data.delivery_type) {
|
||||
case 'store':
|
||||
this.$util.redirectTo('/pages_order/detail_pickup', {
|
||||
order_id: data.relate_order_id
|
||||
});
|
||||
break;
|
||||
case 'local':
|
||||
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
||||
order_id: data.relate_order_id
|
||||
});
|
||||
break;
|
||||
default:
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: data.relate_order_id
|
||||
});
|
||||
}
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_order/detail_point', {
|
||||
order_id: data.order_id
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
} else if (item.from_type == 'pointcash') {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
} else if (item.from_type == 'memberconsume') {
|
||||
// this.$util.redirectTo('/pages_order/detail', {
|
||||
// order_id: item.type_tag
|
||||
// });
|
||||
} else if (item.from_type == 'pointexchangerefund' && parseInt(item.type_tag) != 0) {
|
||||
this.$util.redirectTo('/pages_order/detail_point', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
} else if (item.from_type == 'refund' && parseInt(item.type_tag) != 0) {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: item.type_tag
|
||||
});
|
||||
}
|
||||
},
|
||||
//获得列表数据
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num,
|
||||
account_type: 'point',
|
||||
from_type: this.searchType.from_type,
|
||||
date: this.searchType.date,
|
||||
related_id: this.related_id
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) {
|
||||
this.dataList = []; //如果是第一页需手动制空列表
|
||||
this.related_id = 0;
|
||||
}
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.tab {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
z-index: 10;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
height: 80rpx;
|
||||
background-color: $color-bg;
|
||||
|
||||
view {
|
||||
flex: 1;
|
||||
text-align: center;
|
||||
line-height: 80rpx;
|
||||
|
||||
text {
|
||||
margin-left: 10rpx;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
.tab-left{
|
||||
display: flex;
|
||||
padding-left: 30rpx;
|
||||
}
|
||||
.tab-right{
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
padding-right: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cart-empty {
|
||||
margin-top: 208rpx !important;
|
||||
}
|
||||
|
||||
.detailed-wrap {
|
||||
background: #fff;
|
||||
position: relative;
|
||||
z-index: 9;
|
||||
padding-top: 20rpx;
|
||||
|
||||
.head {
|
||||
display: flex;
|
||||
height: 90rpx;
|
||||
|
||||
& > view {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
padding: 0 $padding;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cont {
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
margin: 0 auto;
|
||||
|
||||
.detailed-item {
|
||||
padding: 30rpx 0 32rpx;
|
||||
margin: 0 32rpx;
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
position: relative;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-of-type {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.info {
|
||||
padding-right: 180rpx;
|
||||
|
||||
.event {
|
||||
font-size: $font-size-base;
|
||||
line-height: 1.3;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.time-box {
|
||||
line-height: 1;
|
||||
margin-top: 24rpx;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: $font-size-activity-tag;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.num {
|
||||
width: 160rpx;
|
||||
position: absolute;
|
||||
right: 17rpx;
|
||||
top: 50%;
|
||||
transform: translateY(-50%);
|
||||
text-align: right;
|
||||
font-size: $font-size-toolbar;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,80 +1,80 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
collectionList: [],
|
||||
isShowEmpty: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//跳转至详情页
|
||||
toDetail(e) {
|
||||
this.$util.redirectTo("/pages_goods/detail", {
|
||||
goods_id: e.goods_id
|
||||
});
|
||||
},
|
||||
//请求数据
|
||||
getData(mescroll) {
|
||||
this.isShowEmpty = false;
|
||||
let url = "/api/goodscollect/page"
|
||||
let array = []
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num,
|
||||
},
|
||||
async: false,
|
||||
}).then((res) => {
|
||||
let newArr = res.data?.list || [];
|
||||
for (var i = 0; i < newArr.length; i++) {
|
||||
newArr[i].composite_score = Math.floor((parseFloat(newArr[i].shop_desccredit) + parseFloat(newArr[i].shop_servicecredit) + parseFloat(newArr[i].shop_deliverycredit)) / 3).toFixed(1);
|
||||
}
|
||||
array = array.concat(newArr);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.collectionList = []; //如果是第一页需手动制空列表
|
||||
this.collectionList = this.collectionList.concat(newArr); //追加新数据
|
||||
mescroll.endSuccess(array.length);
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
this.isShowEmpty = true;
|
||||
})
|
||||
|
||||
},
|
||||
//监听下拉刷新,初始化页面数据
|
||||
listenRefresh(e) {
|
||||
this.$refs.goodsRecommend.init();
|
||||
},
|
||||
//删除某一项
|
||||
deleteItem(e) {
|
||||
this.$api.sendRequest({
|
||||
url: "/api/goodscollect/delete",
|
||||
data: {
|
||||
goods_id: e
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: "删除成功"
|
||||
})
|
||||
let array = this.collectionList;
|
||||
let newArray = array.filter((v) => {
|
||||
return v.goods_id != e;
|
||||
})
|
||||
this.collectionList = newArray;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
imageError(index) {
|
||||
this.collectionList[index].logo = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
goodsImageError(index) {
|
||||
this.collectionList[index].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}
|
||||
};
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
collectionList: [],
|
||||
isShowEmpty: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
//跳转至详情页
|
||||
toDetail(e) {
|
||||
this.$util.redirectTo("/pages_goods/detail", {
|
||||
goods_id: e.goods_id
|
||||
});
|
||||
},
|
||||
//请求数据
|
||||
getData(mescroll) {
|
||||
this.isShowEmpty = false;
|
||||
let url = "/api/goodscollect/page"
|
||||
let array = []
|
||||
this.$api.sendRequest({
|
||||
url: url,
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num,
|
||||
},
|
||||
async: false,
|
||||
}).then((res) => {
|
||||
let newArr = res.data?.list || [];
|
||||
for (var i = 0; i < newArr.length; i++) {
|
||||
newArr[i].composite_score = Math.floor((parseFloat(newArr[i].shop_desccredit) + parseFloat(newArr[i].shop_servicecredit) + parseFloat(newArr[i].shop_deliverycredit)) / 3).toFixed(1);
|
||||
}
|
||||
array = array.concat(newArr);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.collectionList = []; //如果是第一页需手动制空列表
|
||||
this.collectionList = this.collectionList.concat(newArr); //追加新数据
|
||||
mescroll.endSuccess(array.length);
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
this.isShowEmpty = true;
|
||||
})
|
||||
|
||||
},
|
||||
//监听下拉刷新,初始化页面数据
|
||||
listenRefresh(e) {
|
||||
this.$refs.goodsRecommend.init();
|
||||
},
|
||||
//删除某一项
|
||||
deleteItem(e) {
|
||||
this.$api.sendRequest({
|
||||
url: "/api/goodscollect/delete",
|
||||
data: {
|
||||
goods_id: e
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang("member.account.l118")
|
||||
})
|
||||
let array = this.collectionList;
|
||||
let newArray = array.filter((v) => {
|
||||
return v.goods_id != e;
|
||||
})
|
||||
this.collectionList = newArray;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
imageError(index) {
|
||||
this.collectionList[index].logo = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
goodsImageError(index) {
|
||||
this.collectionList[index].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,115 +1,115 @@
|
||||
export default {
|
||||
methods: {
|
||||
//获取邀请列表
|
||||
getList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecommend/api/memberrecommend/lists',
|
||||
data: {
|
||||
page: this.page,
|
||||
page_size: this.page_size
|
||||
},
|
||||
success: res => {
|
||||
this.inviteList = this.inviteList.concat(res.data.list);
|
||||
this.total_num = res.data.page_count;
|
||||
}
|
||||
});
|
||||
},
|
||||
moreList() {
|
||||
this.page++;
|
||||
this.isClick = false;
|
||||
if (this.page < this.total_num) {
|
||||
this.getList();
|
||||
this.isClick = true;
|
||||
} else if (this.page == this.total_num) {
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
getBaseInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecommend/api/memberrecommend/info',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.info = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openSharePopup() {
|
||||
this.$refs.sharePopup.open();
|
||||
},
|
||||
// 关闭分享弹出层
|
||||
closeSharePopup() {
|
||||
this.$refs.sharePopup.close();
|
||||
},
|
||||
// 打开规则说明弹出层
|
||||
openRulePopup() {
|
||||
this.$refs.rulePopup.open();
|
||||
},
|
||||
// 打开规则说明弹出层
|
||||
closeRulePopup() {
|
||||
this.$refs.rulePopup.close();
|
||||
},
|
||||
copyUrl() {
|
||||
let text = this.$config.h5Domain + this.$util.INDEX_PAGE_URL;
|
||||
if (this.memberInf && this.memberInfo.member_id) text += '?source_member=' + this.memberInfo.member_id;
|
||||
this.$util.copy(text, () => {
|
||||
this.closeSharePopup();
|
||||
});
|
||||
},
|
||||
// 打开海报弹出层
|
||||
openPosterPopup() {
|
||||
this.getPoster();
|
||||
this.$refs.sharePopup.close();
|
||||
this.$refs.posterPopup.open();
|
||||
},
|
||||
// 关闭海报弹出层
|
||||
closePosterPopup() {
|
||||
this.$refs.posterPopup.close();
|
||||
},
|
||||
//生成海报
|
||||
getPoster() {
|
||||
//活动海报信息
|
||||
let qrcode_param = {
|
||||
source_member: this.memberInfo.member_id
|
||||
};
|
||||
this.$api.sendRequest({
|
||||
url: "/memberrecommend/api/memberrecommend/poster",
|
||||
data: {
|
||||
page: this.$util.INDEX_PAGE_URL,
|
||||
qrcode_param: JSON.stringify(qrcode_param)
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.poster = res.data.path + "?time=" + new Date().getTime();
|
||||
} else {
|
||||
this.posterMsg = res.message;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
savePoster() {
|
||||
let url = this.$util.img(this.poster);
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({
|
||||
title: "保存成功"
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: "保存失败,请稍后重试"
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
export default {
|
||||
methods: {
|
||||
//获取邀请列表
|
||||
getList() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecommend/api/memberrecommend/lists',
|
||||
data: {
|
||||
page: this.page,
|
||||
page_size: this.page_size
|
||||
},
|
||||
success: res => {
|
||||
this.inviteList = this.inviteList.concat(res.data.list);
|
||||
this.total_num = res.data.page_count;
|
||||
}
|
||||
});
|
||||
},
|
||||
moreList() {
|
||||
this.page++;
|
||||
this.isClick = false;
|
||||
if (this.page < this.total_num) {
|
||||
this.getList();
|
||||
this.isClick = true;
|
||||
} else if (this.page == this.total_num) {
|
||||
this.getList();
|
||||
}
|
||||
},
|
||||
getBaseInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecommend/api/memberrecommend/info',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.info = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
openSharePopup() {
|
||||
this.$refs.sharePopup.open();
|
||||
},
|
||||
// 关闭分享弹出层
|
||||
closeSharePopup() {
|
||||
this.$refs.sharePopup.close();
|
||||
},
|
||||
// 打开规则说明弹出层
|
||||
openRulePopup() {
|
||||
this.$refs.rulePopup.open();
|
||||
},
|
||||
// 打开规则说明弹出层
|
||||
closeRulePopup() {
|
||||
this.$refs.rulePopup.close();
|
||||
},
|
||||
copyUrl() {
|
||||
let text = this.$config.h5Domain + this.$util.INDEX_PAGE_URL;
|
||||
if (this.memberInf && this.memberInfo.member_id) text += '?source_member=' + this.memberInfo.member_id;
|
||||
this.$util.copy(text, () => {
|
||||
this.closeSharePopup();
|
||||
});
|
||||
},
|
||||
// 打开海报弹出层
|
||||
openPosterPopup() {
|
||||
this.getPoster();
|
||||
this.$refs.sharePopup.close();
|
||||
this.$refs.posterPopup.open();
|
||||
},
|
||||
// 关闭海报弹出层
|
||||
closePosterPopup() {
|
||||
this.$refs.posterPopup.close();
|
||||
},
|
||||
//生成海报
|
||||
getPoster() {
|
||||
//活动海报信息
|
||||
let qrcode_param = {
|
||||
source_member: this.memberInfo.member_id
|
||||
};
|
||||
this.$api.sendRequest({
|
||||
url: "/memberrecommend/api/memberrecommend/poster",
|
||||
data: {
|
||||
page: this.$util.INDEX_PAGE_URL,
|
||||
qrcode_param: JSON.stringify(qrcode_param)
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.poster = res.data.path + "?time=" + new Date().getTime();
|
||||
} else {
|
||||
this.posterMsg = res.message;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
savePoster() {
|
||||
let url = this.$util.img(this.poster);
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({
|
||||
title: $lang("goods._components.goods-detail-view.detail.l351.t0")
|
||||
});
|
||||
},
|
||||
fail: () => {
|
||||
this.$util.showToast({
|
||||
title: $lang("goods._components.goods-detail-view.detail.l356.t0")
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,90 +1,90 @@
|
||||
export default {
|
||||
methods: {
|
||||
// 清除登录态(token / 用户信息 / 购物车 / 本地存储)
|
||||
clearLoginState() {
|
||||
this.$store.commit('setToken', '');
|
||||
this.$store.commit('setMemberInfo', '');
|
||||
this.$store.dispatch('emptyCart');
|
||||
uni.removeStorageSync('authInfo');
|
||||
uni.removeStorageSync('privacyAgreed');
|
||||
},
|
||||
|
||||
// 退出登录
|
||||
logout() {
|
||||
uni.showModal({
|
||||
title: this.$lang('logoutTitle'),
|
||||
content: this.$lang('logoutContent'),
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 账号注销入口:先查状态,根据状态分流
|
||||
cancellation() {
|
||||
this.getCancelStatus();
|
||||
},
|
||||
|
||||
// 查询注销状态并跳转对应页面
|
||||
// status: undefined/null → 未申请 → 协议页 cancellation.vue
|
||||
// status: 0 → 审核中 → 状态页 cancelstatus.vue
|
||||
// status: 1 → 通过 → 成功页 cancelsuccess.vue
|
||||
// status: -1 → 拒绝 → 拒绝页 cancelrefuse.vue
|
||||
getCancelStatus() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/info',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
if (res.data) {
|
||||
if (res.data.status == 0) {
|
||||
this.$util.redirectTo('/pages_tool/member/cancelstatus');
|
||||
} else if (res.data.status == 1) {
|
||||
this.$util.redirectTo('/pages_tool/member/cancelsuccess');
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/member/cancelrefuse');
|
||||
}
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/member/cancellation');
|
||||
}
|
||||
} else if (res.code == -1) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 提交注销申请并清理登录态(供 assets.vue 等页面调用)
|
||||
submitCancelApply(options = {}) {
|
||||
uni.showModal({
|
||||
title: options.title || '风险提示',
|
||||
content: options.content || '确定要注销当前账号吗?',
|
||||
confirmColor: '#000000',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/apply',
|
||||
success: rres => {
|
||||
if (rres.code >= 0) {
|
||||
if (options.clearStateAndRedirect) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/member/cancelstatus');
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: rres.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
export default {
|
||||
methods: {
|
||||
// 清除登录态(token / 用户信息 / 购物车 / 本地存储)
|
||||
clearLoginState() {
|
||||
this.$store.commit('setToken', '');
|
||||
this.$store.commit('setMemberInfo', '');
|
||||
this.$store.dispatch('emptyCart');
|
||||
uni.removeStorageSync('authInfo');
|
||||
uni.removeStorageSync('privacyAgreed');
|
||||
},
|
||||
|
||||
// 退出登录
|
||||
logout() {
|
||||
uni.showModal({
|
||||
title: this.$lang('login.list.logout_title'),
|
||||
content: this.$lang('login.list.logout_content'),
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 账号注销入口:先查状态,根据状态分流
|
||||
cancellation() {
|
||||
this.getCancelStatus();
|
||||
},
|
||||
|
||||
// 查询注销状态并跳转对应页面
|
||||
// status: undefined/null → 未申请 → 协议页 cancellation.vue
|
||||
// status: 0 → 审核中 → 状态页 cancelstatus.vue
|
||||
// status: 1 → 通过 → 成功页 cancelsuccess.vue
|
||||
// status: -1 → 拒绝 → 拒绝页 cancelrefuse.vue
|
||||
getCancelStatus() {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/info',
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
if (res.data) {
|
||||
if (res.data.status == 0) {
|
||||
this.$util.redirectTo('/pages_tool/member/cancelstatus');
|
||||
} else if (res.data.status == 1) {
|
||||
this.$util.redirectTo('/pages_tool/member/cancelsuccess');
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/member/cancelrefuse');
|
||||
}
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/member/cancellation');
|
||||
}
|
||||
} else if (res.code == -1) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 提交注销申请并清理登录态(供 assets.vue 等页面调用)
|
||||
submitCancelApply(options = {}) {
|
||||
uni.showModal({
|
||||
title: options.title || $lang('member.cancelstatus.l84'),
|
||||
content: options.content || $lang('member.public.js.member-public.l64.t0'),
|
||||
confirmColor: '#000000',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/membercancel/api/membercancel/apply',
|
||||
success: rres => {
|
||||
if (rres.code >= 0) {
|
||||
if (options.clearStateAndRedirect) {
|
||||
this.clearLoginState();
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/member/cancelstatus');
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: rres.message
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,276 +1,276 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showSignDays: [], // 一共展示的天数
|
||||
rule: [{}],
|
||||
hasSign: 0, //今天是否签到
|
||||
signDaysSeries: 0, //连续签到次数
|
||||
MonthData: [], //本月日期信息
|
||||
signList: [],
|
||||
back: '', //返回页
|
||||
redirect: '', //返回方式
|
||||
successTip: {},
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
isActive: "", //判断点击
|
||||
signState: 1,
|
||||
headimg: '',
|
||||
point: 0,
|
||||
growth: 0,
|
||||
signPoint: 0,
|
||||
signGrowth: 0,
|
||||
rewardRuleDay: [],
|
||||
cycle: 0,
|
||||
reward: {}
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.membersignin) {
|
||||
this.$util.showToast({
|
||||
title: '商家未开启会员签到',
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
if (option.back) this.back = option.back;
|
||||
if (option.redirect) this.redirect = option.redirect;
|
||||
|
||||
this.getSignState();
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/signin');
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.headimg = this.memberInfo.headimg;
|
||||
this.signDaysSeries = this.memberInfo.sign_days_series;
|
||||
|
||||
this.getSignPointData();
|
||||
this.getSignGrowthData();
|
||||
this.setPublicShare();
|
||||
|
||||
this.getIsSign();
|
||||
},
|
||||
methods: {
|
||||
// 获取签到累积积分
|
||||
getSignPointData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/sum',
|
||||
data: {
|
||||
account_type: 'point',
|
||||
from_type: 'signin'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.signPoint = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取签到累积成长值
|
||||
getSignGrowthData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/sum',
|
||||
data: {
|
||||
account_type: 'growth',
|
||||
from_type: 'signin'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.signGrowth = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 签到是否开启
|
||||
getSignState() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/membersignin/getSignStatus',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.signState = res.data.is_use;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
navigateBack() {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(this.back, {}, this.redirect);
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}
|
||||
},
|
||||
//获取rule
|
||||
getRule() {
|
||||
this.rewardRuleDay = [];
|
||||
this.$api.sendRequest({
|
||||
url: '/api/membersignin/award',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
|
||||
this.cycle = res.data.cycle || 0;
|
||||
this.rule = res.data.reward || [];
|
||||
let default_point = 0;
|
||||
if (this.rule.length > 0) {
|
||||
this.rule.forEach((item, index) => {
|
||||
if (item.day == 1) {
|
||||
default_point = item.point;
|
||||
} else {
|
||||
this.rewardRuleDay.push(parseInt(item.day));
|
||||
this.reward[item.day] = item.point;
|
||||
}
|
||||
});
|
||||
}
|
||||
//展示7天
|
||||
var showSignDays = [];
|
||||
var start_day = 1;
|
||||
var end_day = 7;
|
||||
var total_day = res.data.cycle;
|
||||
if (this.signDaysSeries > 5) {
|
||||
start_day = this.signDaysSeries - 5;
|
||||
}
|
||||
if (total_day >= (this.signDaysSeries + 1)) {
|
||||
end_day = this.signDaysSeries + 1;
|
||||
}
|
||||
if (this.signDaysSeries <= 5) {
|
||||
end_day = 8 - start_day;
|
||||
}
|
||||
|
||||
if ((end_day - start_day) < 7 && total_day >= start_day + 6) {
|
||||
end_day = start_day + 6;
|
||||
}
|
||||
if (total_day == this.signDaysSeries) {
|
||||
start_day = this.signDaysSeries - 6;
|
||||
end_day = this.signDaysSeries;
|
||||
}
|
||||
|
||||
for (let i = 1; i <= res.data.cycle; i++) {
|
||||
if (i >= start_day && i <= end_day) {
|
||||
showSignDays.push({
|
||||
day: i,
|
||||
is_last: 0,
|
||||
point: default_point
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (showSignDays && showSignDays.length) {
|
||||
showSignDays[showSignDays.length - 1]['is_last'] = 1;
|
||||
}
|
||||
|
||||
for (let i in showSignDays) {
|
||||
let item = showSignDays[i];
|
||||
if (this.$util.inArray(item.day, this.rewardRuleDay) != -1) {
|
||||
showSignDays[i]['point'] = parseInt(this.reward[item.day]) + parseInt(default_point);
|
||||
}
|
||||
}
|
||||
|
||||
this.showSignDays = showSignDays;
|
||||
this.$refs.loadingCover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//判断当前是否签到
|
||||
getIsSign() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/membersignin/issign',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.hasSign = res.data;
|
||||
this.getRule();
|
||||
this.getSignPointData();
|
||||
this.getSignGrowthData();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//签到
|
||||
sign() {
|
||||
if (this.signState == 0) {
|
||||
this.$util.showToast({
|
||||
title: '签到未开启'
|
||||
})
|
||||
}
|
||||
|
||||
if (!this.hasSign && this.signState == 1) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/membersignin/signin',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.successTip = res.data;
|
||||
this.$refs.uniPopup.open()
|
||||
this.getRule();
|
||||
this.getSignPointData();
|
||||
this.getSignGrowthData();
|
||||
this.hasSign = 1;
|
||||
this.signDaysSeries = this.signDaysSeries + 1;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$refs.uniPopup.close()
|
||||
},
|
||||
/**
|
||||
* 设置公众号分享
|
||||
*/
|
||||
setPublicShare() {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/member/signin';
|
||||
|
||||
this.$util.setPublicShare({
|
||||
title: '签到有礼',
|
||||
desc: '天天签到,积分好礼送不停',
|
||||
link: shareUrl,
|
||||
imgUrl: ''
|
||||
},
|
||||
res => {
|
||||
// console.log('公众号分享成功');
|
||||
// this.share();
|
||||
}
|
||||
);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
pointTomorrow: function() {
|
||||
var signDaysSeries = this.signDaysSeries + 1;
|
||||
var point = this.rule[0].point ? parseInt(this.rule[0].point) : 0;
|
||||
for (let i = 1; i < this.rule.length; i++) {
|
||||
let reward = this.rule[i];
|
||||
if (reward.day == signDaysSeries && reward.point) point += parseInt(reward.point);
|
||||
}
|
||||
return point;
|
||||
},
|
||||
showDay: function() {
|
||||
return parseInt(this.signDaysSeries / 7) * 7 + 1;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 自定义分享内容
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
var path = '/pages_tool/member/signin';
|
||||
return {
|
||||
title: '签到有礼,天天签到,积分好礼送不停',
|
||||
imageUrl: '',
|
||||
path: path,
|
||||
success: res => {},
|
||||
fail: res => {},
|
||||
complete: res => {}
|
||||
};
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
showSignDays: [], // 一共展示的天数
|
||||
rule: [{}],
|
||||
hasSign: 0, //今天是否签到
|
||||
signDaysSeries: 0, //连续签到次数
|
||||
MonthData: [], //本月日期信息
|
||||
signList: [],
|
||||
back: '', //返回页
|
||||
redirect: '', //返回方式
|
||||
successTip: {},
|
||||
startDate: null,
|
||||
endDate: null,
|
||||
isActive: "", //判断点击
|
||||
signState: 1,
|
||||
headimg: '',
|
||||
point: 0,
|
||||
growth: 0,
|
||||
signPoint: 0,
|
||||
signGrowth: 0,
|
||||
rewardRuleDay: [],
|
||||
cycle: 0,
|
||||
reward: {}
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
setTimeout( () => {
|
||||
if (!this.addonIsExist.membersignin) {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.public.js.signin.l31'),
|
||||
mask: true,
|
||||
duration: 2000
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
}, 2000);
|
||||
}
|
||||
},1000);
|
||||
|
||||
if (option.back) this.back = option.back;
|
||||
if (option.redirect) this.redirect = option.redirect;
|
||||
|
||||
this.getSignState();
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/member/signin');
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.headimg = this.memberInfo.headimg;
|
||||
this.signDaysSeries = this.memberInfo.sign_days_series;
|
||||
|
||||
this.getSignPointData();
|
||||
this.getSignGrowthData();
|
||||
this.setPublicShare();
|
||||
|
||||
this.getIsSign();
|
||||
},
|
||||
methods: {
|
||||
// 获取签到累积积分
|
||||
getSignPointData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/sum',
|
||||
data: {
|
||||
account_type: 'point',
|
||||
from_type: 'signin'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.signPoint = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 获取签到累积成长值
|
||||
getSignGrowthData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberaccount/sum',
|
||||
data: {
|
||||
account_type: 'growth',
|
||||
from_type: 'signin'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.signGrowth = res.data;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
// 签到是否开启
|
||||
getSignState() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/membersignin/getSignStatus',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.signState = res.data.is_use;
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
navigateBack() {
|
||||
if (this.back != '') {
|
||||
this.$util.redirectTo(this.back, {}, this.redirect);
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL);
|
||||
}
|
||||
},
|
||||
//获取rule
|
||||
getRule() {
|
||||
this.rewardRuleDay = [];
|
||||
this.$api.sendRequest({
|
||||
url: '/api/membersignin/award',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
|
||||
this.cycle = res.data.cycle || 0;
|
||||
this.rule = res.data.reward || [];
|
||||
let default_point = 0;
|
||||
if (this.rule.length > 0) {
|
||||
this.rule.forEach((item, index) => {
|
||||
if (item.day == 1) {
|
||||
default_point = item.point;
|
||||
} else {
|
||||
this.rewardRuleDay.push(parseInt(item.day));
|
||||
this.reward[item.day] = item.point;
|
||||
}
|
||||
});
|
||||
}
|
||||
//展示7天
|
||||
var showSignDays = [];
|
||||
var start_day = 1;
|
||||
var end_day = 7;
|
||||
var total_day = res.data.cycle;
|
||||
if (this.signDaysSeries > 5) {
|
||||
start_day = this.signDaysSeries - 5;
|
||||
}
|
||||
if (total_day >= (this.signDaysSeries + 1)) {
|
||||
end_day = this.signDaysSeries + 1;
|
||||
}
|
||||
if (this.signDaysSeries <= 5) {
|
||||
end_day = 8 - start_day;
|
||||
}
|
||||
|
||||
if ((end_day - start_day) < 7 && total_day >= start_day + 6) {
|
||||
end_day = start_day + 6;
|
||||
}
|
||||
if (total_day == this.signDaysSeries) {
|
||||
start_day = this.signDaysSeries - 6;
|
||||
end_day = this.signDaysSeries;
|
||||
}
|
||||
|
||||
for (let i = 1; i <= res.data.cycle; i++) {
|
||||
if (i >= start_day && i <= end_day) {
|
||||
showSignDays.push({
|
||||
day: i,
|
||||
is_last: 0,
|
||||
point: default_point
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if (showSignDays && showSignDays.length) {
|
||||
showSignDays[showSignDays.length - 1]['is_last'] = 1;
|
||||
}
|
||||
|
||||
for (let i in showSignDays) {
|
||||
let item = showSignDays[i];
|
||||
if (this.$util.inArray(item.day, this.rewardRuleDay) != -1) {
|
||||
showSignDays[i]['point'] = parseInt(this.reward[item.day]) + parseInt(default_point);
|
||||
}
|
||||
}
|
||||
|
||||
this.showSignDays = showSignDays;
|
||||
this.$refs.loadingCover.hide();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//判断当前是否签到
|
||||
getIsSign() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/membersignin/issign',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.hasSign = res.data;
|
||||
this.getRule();
|
||||
this.getSignPointData();
|
||||
this.getSignGrowthData();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
//签到
|
||||
sign() {
|
||||
if (this.signState == 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang('member.public.js.signin.l201')
|
||||
})
|
||||
}
|
||||
|
||||
if (!this.hasSign && this.signState == 1) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/membersignin/signin',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.successTip = res.data;
|
||||
this.$refs.uniPopup.open()
|
||||
this.getRule();
|
||||
this.getSignPointData();
|
||||
this.getSignGrowthData();
|
||||
this.hasSign = 1;
|
||||
this.signDaysSeries = this.signDaysSeries + 1;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
})
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
close() {
|
||||
this.$refs.uniPopup.close()
|
||||
},
|
||||
/**
|
||||
* 设置公众号分享
|
||||
*/
|
||||
setPublicShare() {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/member/signin';
|
||||
|
||||
this.$util.setPublicShare({
|
||||
title: $lang('member.public.js.signin.l236'),
|
||||
desc: $lang('member.public.js.signin.l237'),
|
||||
link: shareUrl,
|
||||
imgUrl: ''
|
||||
},
|
||||
res => {
|
||||
// console.log('公众号分享成功');
|
||||
// this.share();
|
||||
}
|
||||
);
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
pointTomorrow: function() {
|
||||
var signDaysSeries = this.signDaysSeries + 1;
|
||||
var point = this.rule[0].point ? parseInt(this.rule[0].point) : 0;
|
||||
for (let i = 1; i < this.rule.length; i++) {
|
||||
let reward = this.rule[i];
|
||||
if (reward.day == signDaysSeries && reward.point) point += parseInt(reward.point);
|
||||
}
|
||||
return point;
|
||||
},
|
||||
showDay: function() {
|
||||
return parseInt(this.signDaysSeries / 7) * 7 + 1;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 自定义分享内容
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
var path = '/pages_tool/member/signin';
|
||||
return {
|
||||
title: $lang('member.public.js.signin.l268'),
|
||||
imageUrl: '',
|
||||
path: path,
|
||||
success: res => {},
|
||||
fail: res => {},
|
||||
complete: res => {}
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -1,171 +1,171 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni @getData="getData" class="member-point">
|
||||
<view slot="list">
|
||||
<block v-if="dataList.length">
|
||||
<view class="detailed-wrap">
|
||||
<view class="cont">
|
||||
<view class="detailed-item" v-for="(item, index) in dataList" :key="index" @click="toDetail(item.id)">
|
||||
<view class="info">
|
||||
<view class="event">{{ item.transfer_type_name }}</view>
|
||||
<view>
|
||||
<text class="time">{{ $util.timeStampTurnTime(item.apply_time) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-wrap">
|
||||
<view class="num color-base-text">¥{{ item.apply_money }}</view>
|
||||
<view class="status-name">{{ item.status_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-empty :isIndex="false" text="暂无提现记录"></ns-empty>
|
||||
</block>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(
|
||||
this.$util.LOGIN_PAGE_URL,
|
||||
{
|
||||
back: '/pages_tool/member/point'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//获得列表数据
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.dataList = []; //如果是第一页需手动制空列表
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
toDetail(id) {
|
||||
this.$util.redirectTo('/pages_tool/member/withdrawal_detail', {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.account-box {
|
||||
width: 100vw;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 10rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.tit {
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.iconmn_jifen_fill {
|
||||
font-size: 60rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.point {
|
||||
color: #fff;
|
||||
font-size: 60rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.detailed-wrap {
|
||||
.head {
|
||||
display: flex;
|
||||
height: 90rpx;
|
||||
|
||||
& > view {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
padding: 0 $padding;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cont {
|
||||
background: #fff;
|
||||
|
||||
.detailed-item {
|
||||
padding: $padding 10rpx;
|
||||
margin: 0 $margin-both;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
position: relative;
|
||||
|
||||
&:last-of-type {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.info {
|
||||
padding-right: 180rpx;
|
||||
|
||||
.event {
|
||||
font-size: $font-size-base;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: $font-size-base;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.right-wrap {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
text-align: right;
|
||||
|
||||
.num {
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni @getData="getData" class="member-point">
|
||||
<view slot="list">
|
||||
<block v-if="dataList.length">
|
||||
<view class="detailed-wrap">
|
||||
<view class="cont">
|
||||
<view class="detailed-item" v-for="(item, index) in dataList" :key="index" @click="toDetail(item.id)">
|
||||
<view class="info">
|
||||
<view class="event">{{ item.transfer_type_name }}</view>
|
||||
<view>
|
||||
<text class="time">{{ $util.timeStampTurnTime(item.apply_time) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="right-wrap">
|
||||
<view class="num color-base-text">¥{{ item.apply_money }}</view>
|
||||
<view class="status-name">{{ item.status_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<ns-empty :isIndex="false" text=$lang("fenxiao.withdraw_list.l28")></ns-empty>
|
||||
</block>
|
||||
</view>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(
|
||||
this.$util.LOGIN_PAGE_URL,
|
||||
{
|
||||
back: '/pages_tool/member/point'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
//获得列表数据
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.dataList = []; //如果是第一页需手动制空列表
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
toDetail(id) {
|
||||
this.$util.redirectTo('/pages_tool/member/withdrawal_detail', {
|
||||
id: id
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.account-box {
|
||||
width: 100vw;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
padding-bottom: 10rpx;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.tit {
|
||||
color: #fff;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.iconmn_jifen_fill {
|
||||
font-size: 60rpx;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.point {
|
||||
color: #fff;
|
||||
font-size: 60rpx;
|
||||
margin-left: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.detailed-wrap {
|
||||
.head {
|
||||
display: flex;
|
||||
height: 90rpx;
|
||||
|
||||
& > view {
|
||||
flex: 1;
|
||||
text-align: left;
|
||||
padding: 0 $padding;
|
||||
line-height: 90rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.cont {
|
||||
background: #fff;
|
||||
|
||||
.detailed-item {
|
||||
padding: $padding 10rpx;
|
||||
margin: 0 $margin-both;
|
||||
border-bottom: 2rpx solid #eee;
|
||||
position: relative;
|
||||
|
||||
&:last-of-type {
|
||||
border-bottom: none;
|
||||
}
|
||||
|
||||
.info {
|
||||
padding-right: 180rpx;
|
||||
|
||||
.event {
|
||||
font-size: $font-size-base;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.time {
|
||||
font-size: $font-size-base;
|
||||
color: $color-tip;
|
||||
}
|
||||
}
|
||||
|
||||
.right-wrap {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 0;
|
||||
text-align: right;
|
||||
|
||||
.num {
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,131 +1,131 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="money-wrap">
|
||||
<text>-{{ detail.apply_money }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 状态0待审核1.待转账2已转账 -1拒绝' -->
|
||||
<view class="item">
|
||||
<view class="line-wrap">
|
||||
<text class="label">当前状态</text>
|
||||
<text class="value">{{ detail.status_name }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">交易号</text>
|
||||
<text class="value">{{ detail.withdraw_no }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">手续费</text>
|
||||
<text class="value">¥{{ detail.service_money }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">申请时间</text>
|
||||
<text class="value">{{ $util.timeStampTurnTime(detail.apply_time) }}</text>
|
||||
</view>
|
||||
<view class="line-wrap" v-if="detail.status">
|
||||
<text class="label">审核时间</text>
|
||||
<text class="value">{{ $util.timeStampTurnTime(detail.audit_time) }}</text>
|
||||
</view>
|
||||
<view class="line-wrap" v-if="detail.bank_name">
|
||||
<text class="label">银行名称</text>
|
||||
<text class="value">{{ detail.bank_name }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">收款账号</text>
|
||||
<text class="value">{{ detail.account_number }}</text>
|
||||
</view>
|
||||
<view class="line-wrap" v-if="detail.status == -1 && detail.refuse_reason">
|
||||
<text class="label">拒绝理由</text>
|
||||
<text class="value">{{ detail.refuse_reason }}</text>
|
||||
</view>
|
||||
<view class="line-wrap" v-if="detail.status == 2">
|
||||
<text class="label">转账方式名称</text>
|
||||
<text class="value">{{ detail.transfer_type_name }}</text>
|
||||
</view>
|
||||
<view class="line-wrap" v-if="detail.status == 2">
|
||||
<text class="label">转账时间</text>
|
||||
<text class="value">{{ $util.timeStampTurnTime(detail.payment_time) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: {}
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id || 0;
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
this.getDetail();
|
||||
} else {
|
||||
this.$util.redirectTo(
|
||||
this.$util.LOGIN_PAGE_URL,
|
||||
{
|
||||
back: '/pages_tool/member/point'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/detail',
|
||||
data: {
|
||||
id: this.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.detail = res.data;
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.money-wrap {
|
||||
text-align: center;
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
margin: 40rpx;
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin: 40rpx;
|
||||
|
||||
.line-wrap {
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.label {
|
||||
display: inline-block;
|
||||
width: 200rpx;
|
||||
color: $color-tip;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
.value {
|
||||
display: inline-block;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view class="money-wrap">
|
||||
<text>-{{ detail.apply_money }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 状态0待审核1.待转账2已转账 -1拒绝' -->
|
||||
<view class="item">
|
||||
<view class="line-wrap">
|
||||
<text class="label">{{ $lang("fenxiao.withdrawal_detail.l10") }}</text>
|
||||
<text class="value">{{ detail.status_name }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">{{ $lang("fenxiao.withdrawal_detail.l14") }}</text>
|
||||
<text class="value">{{ detail.withdraw_no }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">{{ $lang("fenxiao.withdrawal_detail.l18") }}</text>
|
||||
<text class="value">¥{{ detail.service_money }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">{{ $lang("fenxiao.withdrawal_detail.l22") }}</text>
|
||||
<text class="value">{{ $util.timeStampTurnTime(detail.apply_time) }}</text>
|
||||
</view>
|
||||
<view class="line-wrap" v-if="detail.status">
|
||||
<text class="label">{{ $lang("fenxiao.withdrawal_detail.l26") }}</text>
|
||||
<text class="value">{{ $util.timeStampTurnTime(detail.audit_time) }}</text>
|
||||
</view>
|
||||
<view class="line-wrap" v-if="detail.bank_name">
|
||||
<text class="label">{{ $lang("fenxiao.withdrawal_detail.l30") }}</text>
|
||||
<text class="value">{{ detail.bank_name }}</text>
|
||||
</view>
|
||||
<view class="line-wrap">
|
||||
<text class="label">{{ $lang("fenxiao.withdrawal_detail.l34") }}</text>
|
||||
<text class="value">{{ detail.account_number }}</text>
|
||||
</view>
|
||||
<view class="line-wrap" v-if="detail.status == -1 && detail.refuse_reason">
|
||||
<text class="label">{{ $lang("fenxiao.withdrawal_detail.l38") }}</text>
|
||||
<text class="value">{{ detail.refuse_reason }}</text>
|
||||
</view>
|
||||
<view class="line-wrap" v-if="detail.status == 2">
|
||||
<text class="label">{{ $lang("fenxiao.withdrawal_detail.l42") }}</text>
|
||||
<text class="value">{{ detail.transfer_type_name }}</text>
|
||||
</view>
|
||||
<view class="line-wrap" v-if="detail.status == 2">
|
||||
<text class="label">{{ $lang("fenxiao.withdrawal_detail.l46") }}</text>
|
||||
<text class="value">{{ $util.timeStampTurnTime(detail.payment_time) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
id: 0,
|
||||
detail: {}
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
this.id = option.id || 0;
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
this.getDetail();
|
||||
} else {
|
||||
this.$util.redirectTo(
|
||||
this.$util.LOGIN_PAGE_URL,
|
||||
{
|
||||
back: '/pages_tool/member/point'
|
||||
},
|
||||
'redirectTo'
|
||||
);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getDetail() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/memberwithdraw/detail',
|
||||
data: {
|
||||
id: this.id
|
||||
},
|
||||
success: res => {
|
||||
if (res.data) {
|
||||
this.detail = res.data;
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.money-wrap {
|
||||
text-align: center;
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
margin: 40rpx;
|
||||
border-bottom: 2rpx solid $color-line;
|
||||
padding: 40rpx;
|
||||
}
|
||||
|
||||
.item {
|
||||
margin: 40rpx;
|
||||
|
||||
.line-wrap {
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
.label {
|
||||
display: inline-block;
|
||||
width: 200rpx;
|
||||
color: $color-tip;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
.value {
|
||||
display: inline-block;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,139 +1,139 @@
|
||||
<template>
|
||||
<view :style="themeColor" class="page">
|
||||
<view class="notice-title">{{ detail.title }}</view>
|
||||
<view class="notice-meta">
|
||||
<text class="notice-time">发表时间: {{ $util.timeStampTurnTime(detail.create_time) }}</text>
|
||||
</view>
|
||||
<view class="notice-content"><rich-text :nodes="content"></rich-text></view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import htmlParser from '@/common/js/html-parser';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
noticeId: 0,
|
||||
content: '',
|
||||
detail: {}
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.noticeId = options.notice_id || 0;
|
||||
// 小程序扫码进入
|
||||
if (options.scene) {
|
||||
var sceneParams = decodeURIComponent(options.scene);
|
||||
this.noticeId = sceneParams.split('-')[1];
|
||||
}
|
||||
if (this.noticeId == 0) {
|
||||
this.$util.redirectTo('/pages_tool/notice/list', {}, 'redirectTo');
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/notice/info',
|
||||
data: {
|
||||
id: this.noticeId
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data) {
|
||||
this.detail = res.data;
|
||||
this.content = htmlParser(res.data.content);
|
||||
this.$langConfig.title(this.detail.title);
|
||||
this.setPublicShare();
|
||||
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/notice/list', {}, 'redirectTo');
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_tool/notice/list', {}, 'redirectTo');
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.$util.redirectTo('/pages_tool/notice/list', {}, 'redirectTo');
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置公众号分享
|
||||
setPublicShare() {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/notice/detail?notice_id=' + this.noticeId;
|
||||
this.$util.setPublicShare({
|
||||
title: this.detail.title,
|
||||
desc: '',
|
||||
link: shareUrl,
|
||||
imgUrl: this.siteInfo ? this.$util.img(this.siteInfo.logo_square) :
|
||||
''
|
||||
});
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var title = '[公告]' + this.detail.title;
|
||||
var path = '/pages_tool/notice/detail?notice_id=' + this.noticeId;
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => {},
|
||||
fail: res => {}
|
||||
};
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline() {
|
||||
var title = this.detail.title;
|
||||
var query = 'notice_id=' + this.noticeId;
|
||||
return {
|
||||
title: title,
|
||||
query: query,
|
||||
imageUrl: ''
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.notice-title {
|
||||
font-size: $font-size-toolbar;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.notice-content {
|
||||
margin-top: $margin-updown;
|
||||
word-break: break-all;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
.notice-meta {
|
||||
text-align: left;
|
||||
margin-top: $margin-updown;
|
||||
color: $color-tip;
|
||||
|
||||
.notice-time {
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor" class="page">
|
||||
<view class="notice-title">{{ detail.title }}</view>
|
||||
<view class="notice-meta">
|
||||
<text class="notice-time">发表时间: {{ $util.timeStampTurnTime(detail.create_time) }}</text>
|
||||
</view>
|
||||
<view class="notice-content"><rich-text :nodes="content"></rich-text></view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import htmlParser from '@/common/js/html-parser';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
noticeId: 0,
|
||||
content: '',
|
||||
detail: {}
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
this.noticeId = options.notice_id || 0;
|
||||
// 小程序扫码进入
|
||||
if (options.scene) {
|
||||
var sceneParams = decodeURIComponent(options.scene);
|
||||
this.noticeId = sceneParams.split('-')[1];
|
||||
}
|
||||
if (this.noticeId == 0) {
|
||||
this.$util.redirectTo('/pages_tool/notice/list', {}, 'redirectTo');
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
this.getData();
|
||||
},
|
||||
methods: {
|
||||
getData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/notice/info',
|
||||
data: {
|
||||
id: this.noticeId
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
if (res.data) {
|
||||
this.detail = res.data;
|
||||
this.content = htmlParser(res.data.content);
|
||||
this.$langConfig.title(this.detail.title);
|
||||
this.setPublicShare();
|
||||
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_tool/notice/list', {}, 'redirectTo');
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_tool/notice/list', {}, 'redirectTo');
|
||||
}, 2000);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.$util.redirectTo('/pages_tool/notice/list', {}, 'redirectTo');
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
// 设置公众号分享
|
||||
setPublicShare() {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/notice/detail?notice_id=' + this.noticeId;
|
||||
this.$util.setPublicShare({
|
||||
title: this.detail.title,
|
||||
desc: '',
|
||||
link: shareUrl,
|
||||
imgUrl: this.siteInfo ? this.$util.img(this.siteInfo.logo_square) :
|
||||
''
|
||||
});
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var title = $lang('notice.detail.l87') + this.detail.title;
|
||||
var path = '/pages_tool/notice/detail?notice_id=' + this.noticeId;
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => {},
|
||||
fail: res => {}
|
||||
};
|
||||
},
|
||||
//分享到朋友圈
|
||||
onShareTimeline() {
|
||||
var title = this.detail.title;
|
||||
var query = 'notice_id=' + this.noticeId;
|
||||
return {
|
||||
title: title,
|
||||
query: query,
|
||||
imageUrl: ''
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.page {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
padding: 30rpx;
|
||||
box-sizing: border-box;
|
||||
background-color: #fff;
|
||||
}
|
||||
|
||||
.notice-title {
|
||||
font-size: $font-size-toolbar;
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.notice-content {
|
||||
margin-top: $margin-updown;
|
||||
word-break: break-all;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
.notice-meta {
|
||||
text-align: left;
|
||||
margin-top: $margin-updown;
|
||||
color: $color-tip;
|
||||
|
||||
.notice-time {
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,182 +1,182 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni @getData="getData" ref="mescroll" :style="tabBarPagePaddingStyle">
|
||||
<block slot="list">
|
||||
<view class="notice-list" v-if="dataList.length">
|
||||
<view class="notice-item" @click="jumpDetail(item.id)" v-for="(item, index) in dataList"
|
||||
:key="index">
|
||||
<view class="title-info">
|
||||
<view class="title">
|
||||
<text v-if="item.is_top == 1" class="color-base-bg tag">置顶</text>
|
||||
<text class="txt using-hidden">{{ item.title }}</text>
|
||||
</view>
|
||||
<text class="release-time">{{ $util.timeStampTurnTime(item.create_time, 1) }}</text>
|
||||
<view class="iconfont icon-right"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="cart-empty"><ns-empty text="暂无公告" :isIndex="false"></ns-empty></view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.setPublicShare();
|
||||
},
|
||||
methods: {
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/notice/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.dataList = []; //如果是第一页需手动制空列表
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
jumpDetail(e) {
|
||||
this.$util.redirectTo('/pages_tool/notice/detail?notice_id=' + e);
|
||||
},
|
||||
// 设置公众号分享
|
||||
setPublicShare() {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/notice/list';
|
||||
this.$util.setPublicShare({
|
||||
title: '公告',
|
||||
desc: '',
|
||||
link: shareUrl,
|
||||
imgUrl: this.siteInfo ? this.$util.img(this.siteInfo.logo_square) : ''
|
||||
});
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var title = '公告';
|
||||
var path = '/pages_tool/notice/list';
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => { },
|
||||
fail: res => { }
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.cart-empty {
|
||||
padding-top: 308rpx;
|
||||
}
|
||||
|
||||
.notice-list {
|
||||
.notice-item {
|
||||
margin: $margin-updown $margin-both;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
padding: 32rpx 34rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
|
||||
.title-info {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
flex: 6;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.txt {
|
||||
color: #000;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
.tag {
|
||||
font-size: 22rpx;
|
||||
color: #ffffff;
|
||||
line-height: 28rpx;
|
||||
border-radius: 6rpx;
|
||||
padding: 2rpx 6rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.release-time {
|
||||
flex: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-left: 20rpx;
|
||||
color: $color-tip;
|
||||
text-align: right;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
color: $color-tip;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 10rpx;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
color: $color-tip;
|
||||
font-size: $font-size-goods-tag;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<mescroll-uni @getData="getData" ref="mescroll" :style="tabBarPagePaddingStyle">
|
||||
<block slot="list">
|
||||
<view class="notice-list" v-if="dataList.length">
|
||||
<view class="notice-item" @click="jumpDetail(item.id)" v-for="(item, index) in dataList"
|
||||
:key="index">
|
||||
<view class="title-info">
|
||||
<view class="title">
|
||||
<text v-if="item.is_top == 1" class="color-base-bg tag">{{ $lang("notice.list.l10") }}</text>
|
||||
<text class="txt using-hidden">{{ item.title }}</text>
|
||||
</view>
|
||||
<text class="release-time">{{ $util.timeStampTurnTime(item.create_time, 1) }}</text>
|
||||
<view class="iconfont icon-right"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="cart-empty"><ns-empty text="暂无公告" :isIndex="false"></ns-empty></view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
|
||||
<!-- 隐私弹窗 -->
|
||||
<privacy-popup ref="privacyPopup"></privacy-popup>
|
||||
|
||||
<!-- 底部tabBar -->
|
||||
<view id="tab-bar">
|
||||
<diy-bottom-nav></diy-bottom-nav>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dataList: []
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
this.setPublicShare();
|
||||
},
|
||||
methods: {
|
||||
getData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/notice/page',
|
||||
data: {
|
||||
page_size: mescroll.size,
|
||||
page: mescroll.num
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.dataList = []; //如果是第一页需手动制空列表
|
||||
this.dataList = this.dataList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
jumpDetail(e) {
|
||||
this.$util.redirectTo('/pages_tool/notice/detail?notice_id=' + e);
|
||||
},
|
||||
// 设置公众号分享
|
||||
setPublicShare() {
|
||||
let shareUrl = this.$config.h5Domain + '/pages_tool/notice/list';
|
||||
this.$util.setPublicShare({
|
||||
title: $lang('diy.diy-notice.l45.t0'),
|
||||
desc: '',
|
||||
link: shareUrl,
|
||||
imgUrl: this.siteInfo ? this.$util.img(this.siteInfo.logo_square) : ''
|
||||
});
|
||||
}
|
||||
},
|
||||
onShareAppMessage(res) {
|
||||
var title = $lang('diy.diy-notice.l45.t0');
|
||||
var path = '/pages_tool/notice/list';
|
||||
return {
|
||||
title: title,
|
||||
path: path,
|
||||
success: res => { },
|
||||
fail: res => { }
|
||||
};
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.cart-empty {
|
||||
padding-top: 308rpx;
|
||||
}
|
||||
|
||||
.notice-list {
|
||||
.notice-item {
|
||||
margin: $margin-updown $margin-both;
|
||||
background: #fff;
|
||||
border-radius: 10rpx;
|
||||
padding: 32rpx 34rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
line-height: 1;
|
||||
|
||||
.title-info {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
|
||||
.title {
|
||||
flex: 6;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
.txt {
|
||||
color: #000;
|
||||
font-size: $font-size-base;
|
||||
}
|
||||
|
||||
.tag {
|
||||
font-size: 22rpx;
|
||||
color: #ffffff;
|
||||
line-height: 28rpx;
|
||||
border-radius: 6rpx;
|
||||
padding: 2rpx 6rpx;
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.release-time {
|
||||
flex: 2;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
margin-left: 20rpx;
|
||||
color: $color-tip;
|
||||
text-align: right;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
color: $color-tip;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
|
||||
.content {
|
||||
margin-top: 10rpx;
|
||||
display: inline-block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
width: 100%;
|
||||
color: $color-tip;
|
||||
font-size: $font-size-goods-tag;
|
||||
padding-bottom: 30rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -1,151 +1,151 @@
|
||||
<template>
|
||||
<view :style="themeColor" class="activist-container">
|
||||
<mescroll-uni ref="mescroll" @getData="getListData">
|
||||
<block slot="list">
|
||||
<view class="container">
|
||||
<block v-if="refundList.length">
|
||||
<view class="order-item" v-for="(item, index) in refundList" :key="index">
|
||||
<view class="order-header">
|
||||
<text class="status-num font-size-base">{{ item.order_no }}</text>
|
||||
<view class="status-name" v-if="item.refund_status == 3">退款成功</view>
|
||||
<view class="status-name color-base-text" v-if="item.refund_status == 1">退款中</view>
|
||||
<view class="status-name color-base-text" v-if="item.refund_status == -1">退款失败</view>
|
||||
</view>
|
||||
<view class="goods-wrap">
|
||||
<image :src="$util.img(item.sku_image, { size: 'mid' })" @error="imageError(index)" mode="aspectFill" :lazy-load="true" show-menu-by-longpress></image>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name" @click="refundDetail(item.order_goods_id)">{{ item.sku_name }}</view>
|
||||
<view class="goods-num">
|
||||
<view class="num-text color-base-text">{{ item.refund_status_name }}</view>
|
||||
<view class="num-price">
|
||||
<text>¥{{ item.price }}</text>
|
||||
<text class="num">×{{ item.num }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-btn">
|
||||
<view class="btn-text">
|
||||
<text>共{{ item.num }}件商品</text>
|
||||
<text>退款:¥{{ item.refund_status == 3 ? item.refund_real_money : item.refund_apply_money }}</text>
|
||||
</view>
|
||||
<view class="order-action">
|
||||
<view class="order-box-btn" @click="refundDetail(item.order_goods_id)">查看详情</view>
|
||||
<block v-if="item.refund_action.length">
|
||||
<view
|
||||
class="order-box-btn"
|
||||
@click="refundAction(actionItem.event, item)"
|
||||
v-for="(actionItem, actionIndex) in item.refund_action"
|
||||
:key="actionIndex"
|
||||
>
|
||||
{{ actionItem.title }}
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cart-empty" v-if="showEmpty"><ns-empty :isIndex="false" :text="$lang('emptyTips')"></ns-empty></view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import refundMethod from './public/js/refundMethod.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
refundList: [],
|
||||
showEmpty: false
|
||||
};
|
||||
},
|
||||
mixins: [refundMethod],
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo('/pages/order/login', {
|
||||
back: '/pages_tool/order/activist'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getListData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/lists',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size
|
||||
},
|
||||
success: res => {
|
||||
this.showEmpty = true;
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.refundList = []; //如果是第一页需手动制空列表
|
||||
this.refundList = this.refundList.concat(newArr);
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
}
|
||||
});
|
||||
},
|
||||
refundDetail(order_goods_id) {
|
||||
this.$util.redirectTo('/pages_tool/order/refund_detail', {
|
||||
order_goods_id
|
||||
});
|
||||
},
|
||||
refundAction(event, data) {
|
||||
switch (event) {
|
||||
case 'orderRefundCancel': // 撤销维权
|
||||
this.cancleRefund(data.order_goods_id, res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: '撤销成功'
|
||||
});
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'orderRefundDelivery': // 退款发货
|
||||
this.$util.redirectTo('/pages_tool/order/refund_detail', {
|
||||
order_goods_id: data.order_goods_id,
|
||||
action: 'returngoods'
|
||||
});
|
||||
break;
|
||||
case 'orderRefundAsk':
|
||||
this.$util.redirectTo('/pages_tool/order/refund', {
|
||||
order_goods_id: data.order_goods_id
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
imageError(index) {
|
||||
this.refundList[index].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
.cart-empty {
|
||||
padding-top: 308rpx !important;
|
||||
}
|
||||
@import './public/css/activist.scss';
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor" class="activist-container">
|
||||
<mescroll-uni ref="mescroll" @getData="getListData">
|
||||
<block slot="list">
|
||||
<view class="container">
|
||||
<block v-if="refundList.length">
|
||||
<view class="order-item" v-for="(item, index) in refundList" :key="index">
|
||||
<view class="order-header">
|
||||
<text class="status-num font-size-base">{{ item.order_no }}</text>
|
||||
<view class="status-name" v-if="item.refund_status == 3">{{ $lang("tool.order.activist.l10.t0") }}</view>
|
||||
<view class="status-name color-base-text" v-if="item.refund_status == 1">{{ $lang("member.assets.l46") }}</view>
|
||||
<view class="status-name color-base-text" v-if="item.refund_status == -1">{{ $lang("tool.order.activist.l12.t0") }}</view>
|
||||
</view>
|
||||
<view class="goods-wrap">
|
||||
<image :src="$util.img(item.sku_image, { size: 'mid' })" @error="imageError(index)" mode="aspectFill" :lazy-load="true" show-menu-by-longpress></image>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name" @click="refundDetail(item.order_goods_id)">{{ item.sku_name }}</view>
|
||||
<view class="goods-num">
|
||||
<view class="num-text color-base-text">{{ item.refund_status_name }}</view>
|
||||
<view class="num-price">
|
||||
<text>¥{{ item.price }}</text>
|
||||
<text class="num">×{{ item.num }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="goods-btn">
|
||||
<view class="btn-text">
|
||||
<text>{ $lang("goods.cart.l8") } item.num }}件商品</text>
|
||||
<text>{ $lang("tool.order.activist.l30.t0") } item.refund_status == 3 ? item.refund_real_money : item.refund_apply_money }}</text>
|
||||
</view>
|
||||
<view class="order-action">
|
||||
<view class="order-box-btn" @click="refundDetail(item.order_goods_id)">{{ $lang("order.list.l141") }}</view>
|
||||
<block v-if="item.refund_action.length">
|
||||
<view
|
||||
class="order-box-btn"
|
||||
@click="refundAction(actionItem.event, item)"
|
||||
v-for="(actionItem, actionIndex) in item.refund_action"
|
||||
:key="actionIndex"
|
||||
>
|
||||
{{ actionItem.title }}
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="cart-empty" v-if="showEmpty"><ns-empty :isIndex="false" :text="$lang('common.empty.default')"></ns-empty></view>
|
||||
</block>
|
||||
</view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import refundMethod from './public/js/refundMethod.js';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
refundList: [],
|
||||
showEmpty: false
|
||||
};
|
||||
},
|
||||
mixins: [refundMethod],
|
||||
onShow() {
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo('/pages/order/login', {
|
||||
back: '/pages_tool/order/activist'
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getListData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/lists',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size
|
||||
},
|
||||
success: res => {
|
||||
this.showEmpty = true;
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.refundList = []; //如果是第一页需手动制空列表
|
||||
this.refundList = this.refundList.concat(newArr);
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
}
|
||||
});
|
||||
},
|
||||
refundDetail(order_goods_id) {
|
||||
this.$util.redirectTo('/pages_tool/order/refund_detail', {
|
||||
order_goods_id
|
||||
});
|
||||
},
|
||||
refundAction(event, data) {
|
||||
switch (event) {
|
||||
case 'orderRefundCancel': // 撤销维权
|
||||
this.cancleRefund(data.order_goods_id, res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang('tool.order.activist.l115.t0')
|
||||
});
|
||||
this.$refs.mescroll.refresh();
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'orderRefundDelivery': // 退款发货
|
||||
this.$util.redirectTo('/pages_tool/order/refund_detail', {
|
||||
order_goods_id: data.order_goods_id,
|
||||
action: 'returngoods'
|
||||
});
|
||||
break;
|
||||
case 'orderRefundAsk':
|
||||
this.$util.redirectTo('/pages_tool/order/refund', {
|
||||
order_goods_id: data.order_goods_id
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
imageError(index) {
|
||||
this.refundList[index].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .fixed {
|
||||
position: relative;
|
||||
top: 0;
|
||||
}
|
||||
.cart-empty {
|
||||
padding-top: 308rpx !important;
|
||||
}
|
||||
@import './public/css/activist.scss';
|
||||
</style>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</view>
|
||||
<view class="eval-star" v-if="!isEvaluate">
|
||||
<view class="star-box">
|
||||
<view class="star-title color-base-bg-before">描述相符</view>
|
||||
<view class="star-title color-base-bg-before">{{ $lang("tool.order.evaluate.l16.t0") }}</view>
|
||||
<view class="rate-box"><sx-rate :value="goodsEvalList[index].scores" :index="index"
|
||||
@change="setStar" /></view>
|
||||
<view class="grade-li">
|
||||
@@ -26,11 +26,11 @@
|
||||
: ''
|
||||
"></view>
|
||||
<view class="font-size-tag color-base-text"
|
||||
v-if="goodsEvalList[index].explain_type == '1'">好评</view>
|
||||
v-if="goodsEvalList[index].explain_type == '1'">{{ $lang("tool.goods.evaluate.l82.t0") }}</view>
|
||||
<view class="font-size-tag color-base-text"
|
||||
v-if="goodsEvalList[index].explain_type == '2'">中评</view>
|
||||
v-if="goodsEvalList[index].explain_type == '2'">{{ $lang("tool.goods.evaluate.l82.t1") }}</view>
|
||||
<view class="font-size-tag color-base-text"
|
||||
v-if="goodsEvalList[index].explain_type == '3'">差评</view>
|
||||
v-if="goodsEvalList[index].explain_type == '3'">{{ $lang("tool.goods.evaluate.l82.t2") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -39,12 +39,12 @@
|
||||
<view class="eval-text">
|
||||
<view class="text-box">
|
||||
<block v-if="!isEvaluate">
|
||||
<textarea placeholder="请在此处输入您的评价" v-model="goodsEvalList[index].content"
|
||||
<textarea placeholder=$lang("tool.order.evaluate.l42.t0") v-model="goodsEvalList[index].content"
|
||||
maxlength="200" />
|
||||
<text class="maxSize">{{ goodsEvalList[index].content.length }}/200</text>
|
||||
</block>
|
||||
<block v-else>
|
||||
<textarea placeholder="请在此处输入您的追评" v-model="goodsEvalList[index].again_content"
|
||||
<textarea placeholder=$lang("tool.order.evaluate.l47.t0") v-model="goodsEvalList[index].again_content"
|
||||
maxlength="200" />
|
||||
<text class="maxSize">{{ goodsEvalList[index].again_content.length }}/200</text>
|
||||
</block>
|
||||
@@ -69,9 +69,9 @@
|
||||
<view class="all-election" @click="isAll()" v-if="!isEvaluate">
|
||||
<view class="iconfont color-base-text"
|
||||
:class="isAnonymous ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
|
||||
<text>匿名</text>
|
||||
<text>{{ $lang("tool.order.evaluate.l72.t0") }}</text>
|
||||
</view>
|
||||
<view class="action-btn"><button type="primary" @click="save()">提交</button></view>
|
||||
<view class="action-btn"><button type="primary" @click="save()">{{ $lang("diy.diy-form.l142.t0") }}</button></view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
|
||||
@@ -1,170 +1,170 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<scroll-view class="order-nav" :scroll-x="true" :show-scrollbar="false">
|
||||
<view v-for="(packageItem, packageIndex) in packageList" :key="packageIndex" class="uni-tab-item" @click="ontabtap(packageIndex)">
|
||||
<text class="uni-tab-item-title" :class="packageIndex == currIndex ? 'uni-tab-item-title-active color-base-border color-base-text' : ''">
|
||||
{{ packageItem.package_name }}
|
||||
</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-for="(packageItem, packageIndex) in packageList" :key="packageIndex" class="swiper-item" v-show="packageIndex == currIndex">
|
||||
<view class="container">
|
||||
<view class="goods-wrap">
|
||||
<view class="body">
|
||||
<view class="goods" v-for="(goodsItem, goodsIndex) in packageItem.goods_list" :key="goodsIndex">
|
||||
<view class="goods-img" @click="toGoodsDetail(goodsItem.sku_id)">
|
||||
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(packageIndex, goodsIndex)" mode="aspectFill" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view @click="toGoodsDetail(goodsItem.sku_id)" class="goods-name">{{ goodsItem.sku_name }}</view>
|
||||
<view class="goods-sub-section">
|
||||
<view>
|
||||
<text>
|
||||
<text class="iconfont icon-close"></text>
|
||||
{{ goodsItem.num }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="express-company-wrap" v-if="packageItem.delivery_type == 1">
|
||||
<view class="company-logo"><image :src="$util.img(packageItem.express_company_image)" show-menu-by-longpress></image></view>
|
||||
<view class="info">
|
||||
<view class="company">
|
||||
<text>承运公司: {{ packageItem.express_company_name }}</text>
|
||||
</view>
|
||||
<view class="no">
|
||||
<text>
|
||||
运单号:
|
||||
<text class="color-tip">{{ packageItem.delivery_no }}</text>
|
||||
</text>
|
||||
<text class="iconfont icon-fuzhi" @click="copyDeliveryNo(packageItem.delivery_no)"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="track-wrap" v-if="packageItem.delivery_type == 1">
|
||||
<block v-if="packageItem.trace.success && packageItem.trace.list.length != 0">
|
||||
<view
|
||||
class="track-item"
|
||||
v-for="(traceItem, traceIndex) in packageItem.trace.list"
|
||||
:class="traceIndex == 0 ? 'active' : ''"
|
||||
:key="traceIndex"
|
||||
>
|
||||
<view class="dot" :class="traceIndex == 0 ? 'color-base-bg' : ''"></view>
|
||||
<view class="msg">
|
||||
<view class="text" :class="traceIndex == 0 ? 'color-base-text' : ''">{{ traceItem.remark }}</view>
|
||||
<view class="time" :class="traceIndex == 0 ? 'color-base-text' : ''">{{ traceItem.datetime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else-if="packageItem.trace.success && packageItem.trace.list.length == 0">
|
||||
<view class="fail-wrap font-size-base">{{ packageItem.trace.reason }}</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="fail-wrap font-size-base">{{ packageItem.trace.reason }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderId: '',
|
||||
packageList: [],
|
||||
isIphoneX: false,
|
||||
currIndex: 0,
|
||||
status: 0
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_id) this.orderId = option.order_id;
|
||||
},
|
||||
onShow() {
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getPackageInfo();
|
||||
}
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
methods: {
|
||||
ontabtap(e) {
|
||||
this.currIndex = e;
|
||||
// let index = e.target.dataset.current || e.currentTarget.dataset.current;
|
||||
// this.orderStatus = this.statusList[index].status;
|
||||
// if (this.orderStatus == '') this.mergePayOrder = [];
|
||||
// this.$refs.loadingCover.show();
|
||||
// this.$refs.mescroll.refresh();
|
||||
},
|
||||
getPackageInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/order/package',
|
||||
data: {
|
||||
order_id: this.orderId
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.packageList = res.data;
|
||||
this.packageList.forEach(item => {
|
||||
if (item.trace.list) {
|
||||
item.trace.list = item.trace.list.reverse();
|
||||
}
|
||||
item.status = this.status++;
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '未获取到订单信息!'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
toGoodsDetail(e) {
|
||||
this.$util.redirectTo('/pages_goods/detail', { sku_id: e });
|
||||
},
|
||||
imageError(packageIndex, goodsIndex) {
|
||||
this.packageList[packageIndex].goods_list[goodsIndex].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
copyDeliveryNo(value){
|
||||
this.$util.copy(value);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/logistics.scss';
|
||||
::v-deep .uni-scroll-view ::-webkit-scrollbar {
|
||||
/* 隐藏滚动条,但依旧具备可以滚动的功能 */
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
::v-deep ::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<scroll-view class="order-nav" :scroll-x="true" :show-scrollbar="false">
|
||||
<view v-for="(packageItem, packageIndex) in packageList" :key="packageIndex" class="uni-tab-item" @click="ontabtap(packageIndex)">
|
||||
<text class="uni-tab-item-title" :class="packageIndex == currIndex ? 'uni-tab-item-title-active color-base-border color-base-text' : ''">
|
||||
{{ packageItem.package_name }}
|
||||
</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view v-for="(packageItem, packageIndex) in packageList" :key="packageIndex" class="swiper-item" v-show="packageIndex == currIndex">
|
||||
<view class="container">
|
||||
<view class="goods-wrap">
|
||||
<view class="body">
|
||||
<view class="goods" v-for="(goodsItem, goodsIndex) in packageItem.goods_list" :key="goodsIndex">
|
||||
<view class="goods-img" @click="toGoodsDetail(goodsItem.sku_id)">
|
||||
<image :src="$util.img(goodsItem.sku_image, { size: 'mid' })" @error="imageError(packageIndex, goodsIndex)" mode="aspectFill" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view @click="toGoodsDetail(goodsItem.sku_id)" class="goods-name">{{ goodsItem.sku_name }}</view>
|
||||
<view class="goods-sub-section">
|
||||
<view>
|
||||
<text>
|
||||
<text class="iconfont icon-close"></text>
|
||||
{{ goodsItem.num }}
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="express-company-wrap" v-if="packageItem.delivery_type == 1">
|
||||
<view class="company-logo"><image :src="$util.img(packageItem.express_company_image)" show-menu-by-longpress></image></view>
|
||||
<view class="info">
|
||||
<view class="company">
|
||||
<text>承运公司: {{ packageItem.express_company_name }}</text>
|
||||
</view>
|
||||
<view class="no">
|
||||
<text>
|
||||
运单号:
|
||||
<text class="color-tip">{{ packageItem.delivery_no }}</text>
|
||||
</text>
|
||||
<text class="iconfont icon-fuzhi" @click="copyDeliveryNo(packageItem.delivery_no)"></text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="track-wrap" v-if="packageItem.delivery_type == 1">
|
||||
<block v-if="packageItem.trace.success && packageItem.trace.list.length != 0">
|
||||
<view
|
||||
class="track-item"
|
||||
v-for="(traceItem, traceIndex) in packageItem.trace.list"
|
||||
:class="traceIndex == 0 ? 'active' : ''"
|
||||
:key="traceIndex"
|
||||
>
|
||||
<view class="dot" :class="traceIndex == 0 ? 'color-base-bg' : ''"></view>
|
||||
<view class="msg">
|
||||
<view class="text" :class="traceIndex == 0 ? 'color-base-text' : ''">{{ traceItem.remark }}</view>
|
||||
<view class="time" :class="traceIndex == 0 ? 'color-base-text' : ''">{{ traceItem.datetime }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else-if="packageItem.trace.success && packageItem.trace.list.length == 0">
|
||||
<view class="fail-wrap font-size-base">{{ packageItem.trace.reason }}</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="fail-wrap font-size-base">{{ packageItem.trace.reason }}</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderId: '',
|
||||
packageList: [],
|
||||
isIphoneX: false,
|
||||
currIndex: 0,
|
||||
status: 0
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_id) this.orderId = option.order_id;
|
||||
},
|
||||
onShow() {
|
||||
// 判断登录
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getPackageInfo();
|
||||
}
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
methods: {
|
||||
ontabtap(e) {
|
||||
this.currIndex = e;
|
||||
// let index = e.target.dataset.current || e.currentTarget.dataset.current;
|
||||
// this.orderStatus = this.statusList[index].status;
|
||||
// if (this.orderStatus == '') this.mergePayOrder = [];
|
||||
// this.$refs.loadingCover.show();
|
||||
// this.$refs.mescroll.refresh();
|
||||
},
|
||||
getPackageInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/order/package',
|
||||
data: {
|
||||
order_id: this.orderId
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.packageList = res.data;
|
||||
this.packageList.forEach(item => {
|
||||
if (item.trace.list) {
|
||||
item.trace.list = item.trace.list.reverse();
|
||||
}
|
||||
item.status = this.status++;
|
||||
});
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('order.detail.l737')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
toGoodsDetail(e) {
|
||||
this.$util.redirectTo('/pages_goods/detail', { sku_id: e });
|
||||
},
|
||||
imageError(packageIndex, goodsIndex) {
|
||||
this.packageList[packageIndex].goods_list[goodsIndex].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
copyDeliveryNo(value){
|
||||
this.$util.copy(value);
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/logistics.scss';
|
||||
::v-deep .uni-scroll-view ::-webkit-scrollbar {
|
||||
/* 隐藏滚动条,但依旧具备可以滚动的功能 */
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
::v-deep ::-webkit-scrollbar {
|
||||
display: none;
|
||||
width: 0;
|
||||
height: 0;
|
||||
color: transparent;
|
||||
background: transparent;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,233 +1,233 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderId: null,
|
||||
orderNo: "",
|
||||
isAnonymous: 1, //是否匿名发布 1.匿名,0.公开
|
||||
|
||||
goodsList: [], //订单列表
|
||||
goodsEvalList: [], //评价列表
|
||||
|
||||
imgList: [],
|
||||
isEvaluate: 0, //判断是否为追评
|
||||
|
||||
flag: false, //防止重复点击 ,
|
||||
evaluateConfig: {
|
||||
evaluate_audit: 1,
|
||||
evaluate_show: 0,
|
||||
evaluate_status: 1
|
||||
},
|
||||
|
||||
isIphoneX: false //判断手机是否是iphoneX以上
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
//接收订单号,订单是否是追评等信息
|
||||
options.order_id ? (this.orderId = options.order_id) : this.$util.redirectTo('/pages_order/list');
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||
back: '/pages_tool/order/evaluate?order_id=' + this.orderId
|
||||
}, 'redirectTo');
|
||||
}
|
||||
this.getEvaluateConfig();
|
||||
this.getOrderInfo();
|
||||
},
|
||||
onShow() {
|
||||
//初始化重复点击
|
||||
this.flag = false;
|
||||
},
|
||||
methods: {
|
||||
//获取订单信息
|
||||
getOrderInfo() {
|
||||
//获取订单信息
|
||||
let data = {
|
||||
order_id: this.orderId
|
||||
};
|
||||
this.$api.sendRequest({
|
||||
url: '/api/order/evluateinfo',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.isEvaluate = res.data.evaluate_status
|
||||
this.goodsList = res.data.list;
|
||||
if (this.goodsList.length) {
|
||||
this.orderNo = res.data.list[0].order_no;
|
||||
}
|
||||
if (this.isEvaluate) {
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let array = [];
|
||||
this.imgList.push(array)
|
||||
this.goodsEvalList.push({
|
||||
order_goods_id: res.data.list[i].order_goods_id,
|
||||
goods_id: res.data.list[i].goods_id,
|
||||
sku_id: res.data.list[i].sku_id,
|
||||
again_content: "",
|
||||
again_images: ""
|
||||
});
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let array = [];
|
||||
this.imgList.push(array)
|
||||
this.goodsEvalList.push({
|
||||
content: '', // 评价内容
|
||||
images: "", //图片数组
|
||||
scores: 5, // 评分
|
||||
explain_type: 1, // 评价类型
|
||||
order_goods_id: res.data.list[i].order_goods_id,
|
||||
goods_id: res.data.list[i].goods_id,
|
||||
sku_id: res.data.list[i].sku_id,
|
||||
sku_name: res.data.list[i].sku_name,
|
||||
sku_price: res.data.list[i].price,
|
||||
sku_image: res.data.list[i].sku_image
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: "未获取到订单数据"
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list', {}, "redirectTo");
|
||||
}, 1000)
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//监听评分变化
|
||||
setStar(e) {
|
||||
this.goodsEvalList[e.index].scores = e.value;
|
||||
if (e.value >= 4) {
|
||||
this.goodsEvalList[e.index].explain_type = 1;
|
||||
} else if (1 < e.value && e.value < 4) {
|
||||
this.goodsEvalList[e.index].explain_type = 2
|
||||
} else {
|
||||
this.goodsEvalList[e.index].explain_type = 3
|
||||
}
|
||||
},
|
||||
//切换,是否匿名
|
||||
isAll() {
|
||||
this.isAnonymous ? this.isAnonymous = 0 : this.isAnonymous = 1
|
||||
},
|
||||
//添加图片
|
||||
addImg(e) {
|
||||
let size = this.imgList[e].length ? this.imgList[e].length : 0
|
||||
this.$util.upload(6 - size, {
|
||||
path: 'evaluateimg'
|
||||
}, res => {
|
||||
let arr = this.imgList[e]
|
||||
arr = arr.concat(res);
|
||||
this.imgList[e] = [];
|
||||
this.$set(this.imgList, e, arr)
|
||||
if (this.isEvaluate) {
|
||||
this.goodsEvalList[e].again_images = this.imgList[e].toString()
|
||||
} else {
|
||||
this.goodsEvalList[e].images = this.imgList[e].toString()
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除图片
|
||||
deleteImg(i, index, j) {
|
||||
this.imgList[index].splice(j, 1);
|
||||
if (this.isEvaluate) {
|
||||
this.goodsEvalList[index].again_images = this.imgList[index].toString()
|
||||
} else {
|
||||
this.goodsEvalList[index].images = this.imgList[index].toString()
|
||||
}
|
||||
},
|
||||
// 图片预览
|
||||
preview(i, j) {
|
||||
let urls = this.imgList[j];
|
||||
for (let k = 0; k < urls.length; k++) {
|
||||
urls[k] = this.$util.img(urls[k])
|
||||
}
|
||||
uni.previewImage({
|
||||
urls: urls,
|
||||
current: i
|
||||
});
|
||||
},
|
||||
|
||||
//提交评价
|
||||
save() {
|
||||
if (this.evaluateConfig.evaluate_status == 0) {
|
||||
this.$util.showToast({
|
||||
title: "商家未开启商品评价功能"
|
||||
});
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.goodsEvalList.length; i++) {
|
||||
if (this.isEvaluate) {
|
||||
if (!this.goodsEvalList[i].again_content.trim().length) {
|
||||
this.$util.showToast({
|
||||
title: "商品的评价不能为空哦"
|
||||
});
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!this.goodsEvalList[i].content.trim().length) {
|
||||
this.$util.showToast({
|
||||
title: "商品的评价不能为空哦"
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
let goodsEvaluate = JSON.stringify(this.goodsEvalList)
|
||||
let data = {
|
||||
order_id: this.orderId,
|
||||
goods_evaluate: goodsEvaluate,
|
||||
};
|
||||
if (!this.isEvaluate) {
|
||||
data.order_no = this.orderNo;
|
||||
data.member_name = this.memberInfo.nickname;
|
||||
data.member_headimg = this.memberInfo.headimg;
|
||||
data.is_anonymous = this.isAnonymous;
|
||||
}
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
this.$api.sendRequest({
|
||||
url: this.isEvaluate ? '/api/goodsevaluate/again' : '/api/goodsevaluate/add',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: "评价成功"
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list', {}, "redirectTo");
|
||||
}, 1000);
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
this.flag = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.goodsList[index].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
getEvaluateConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsevaluate/config',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
var data = res.data;
|
||||
this.evaluateConfig = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderId: null,
|
||||
orderNo: "",
|
||||
isAnonymous: 1, //是否匿名发布 1.匿名,0.公开
|
||||
|
||||
goodsList: [], //订单列表
|
||||
goodsEvalList: [], //评价列表
|
||||
|
||||
imgList: [],
|
||||
isEvaluate: 0, //判断是否为追评
|
||||
|
||||
flag: false, //防止重复点击 ,
|
||||
evaluateConfig: {
|
||||
evaluate_audit: 1,
|
||||
evaluate_show: 0,
|
||||
evaluate_status: 1
|
||||
},
|
||||
|
||||
isIphoneX: false //判断手机是否是iphoneX以上
|
||||
};
|
||||
},
|
||||
onLoad(options) {
|
||||
//接收订单号,订单是否是追评等信息
|
||||
options.order_id ? (this.orderId = options.order_id) : this.$util.redirectTo('/pages_order/list');
|
||||
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||
back: '/pages_tool/order/evaluate?order_id=' + this.orderId
|
||||
}, 'redirectTo');
|
||||
}
|
||||
this.getEvaluateConfig();
|
||||
this.getOrderInfo();
|
||||
},
|
||||
onShow() {
|
||||
//初始化重复点击
|
||||
this.flag = false;
|
||||
},
|
||||
methods: {
|
||||
//获取订单信息
|
||||
getOrderInfo() {
|
||||
//获取订单信息
|
||||
let data = {
|
||||
order_id: this.orderId
|
||||
};
|
||||
this.$api.sendRequest({
|
||||
url: '/api/order/evluateinfo',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.isEvaluate = res.data.evaluate_status
|
||||
this.goodsList = res.data.list;
|
||||
if (this.goodsList.length) {
|
||||
this.orderNo = res.data.list[0].order_no;
|
||||
}
|
||||
if (this.isEvaluate) {
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let array = [];
|
||||
this.imgList.push(array)
|
||||
this.goodsEvalList.push({
|
||||
order_goods_id: res.data.list[i].order_goods_id,
|
||||
goods_id: res.data.list[i].goods_id,
|
||||
sku_id: res.data.list[i].sku_id,
|
||||
again_content: "",
|
||||
again_images: ""
|
||||
});
|
||||
}
|
||||
} else {
|
||||
for (let i = 0; i < res.data.list.length; i++) {
|
||||
let array = [];
|
||||
this.imgList.push(array)
|
||||
this.goodsEvalList.push({
|
||||
content: '', // 评价内容
|
||||
images: "", //图片数组
|
||||
scores: 5, // 评分
|
||||
explain_type: 1, // 评价类型
|
||||
order_goods_id: res.data.list[i].order_goods_id,
|
||||
goods_id: res.data.list[i].goods_id,
|
||||
sku_id: res.data.list[i].sku_id,
|
||||
sku_name: res.data.list[i].sku_name,
|
||||
sku_price: res.data.list[i].price,
|
||||
sku_image: res.data.list[i].sku_image
|
||||
});
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang("tool.order.public.js.evaluate.l90.t0")
|
||||
})
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list', {}, "redirectTo");
|
||||
}, 1000)
|
||||
}
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail() {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
//监听评分变化
|
||||
setStar(e) {
|
||||
this.goodsEvalList[e.index].scores = e.value;
|
||||
if (e.value >= 4) {
|
||||
this.goodsEvalList[e.index].explain_type = 1;
|
||||
} else if (1 < e.value && e.value < 4) {
|
||||
this.goodsEvalList[e.index].explain_type = 2
|
||||
} else {
|
||||
this.goodsEvalList[e.index].explain_type = 3
|
||||
}
|
||||
},
|
||||
//切换,是否匿名
|
||||
isAll() {
|
||||
this.isAnonymous ? this.isAnonymous = 0 : this.isAnonymous = 1
|
||||
},
|
||||
//添加图片
|
||||
addImg(e) {
|
||||
let size = this.imgList[e].length ? this.imgList[e].length : 0
|
||||
this.$util.upload(6 - size, {
|
||||
path: 'evaluateimg'
|
||||
}, res => {
|
||||
let arr = this.imgList[e]
|
||||
arr = arr.concat(res);
|
||||
this.imgList[e] = [];
|
||||
this.$set(this.imgList, e, arr)
|
||||
if (this.isEvaluate) {
|
||||
this.goodsEvalList[e].again_images = this.imgList[e].toString()
|
||||
} else {
|
||||
this.goodsEvalList[e].images = this.imgList[e].toString()
|
||||
}
|
||||
});
|
||||
},
|
||||
//删除图片
|
||||
deleteImg(i, index, j) {
|
||||
this.imgList[index].splice(j, 1);
|
||||
if (this.isEvaluate) {
|
||||
this.goodsEvalList[index].again_images = this.imgList[index].toString()
|
||||
} else {
|
||||
this.goodsEvalList[index].images = this.imgList[index].toString()
|
||||
}
|
||||
},
|
||||
// 图片预览
|
||||
preview(i, j) {
|
||||
let urls = this.imgList[j];
|
||||
for (let k = 0; k < urls.length; k++) {
|
||||
urls[k] = this.$util.img(urls[k])
|
||||
}
|
||||
uni.previewImage({
|
||||
urls: urls,
|
||||
current: i
|
||||
});
|
||||
},
|
||||
|
||||
//提交评价
|
||||
save() {
|
||||
if (this.evaluateConfig.evaluate_status == 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang("tool.order.public.js.evaluate.l160.t0")
|
||||
});
|
||||
return;
|
||||
}
|
||||
for (let i = 0; i < this.goodsEvalList.length; i++) {
|
||||
if (this.isEvaluate) {
|
||||
if (!this.goodsEvalList[i].again_content.trim().length) {
|
||||
this.$util.showToast({
|
||||
title: $lang("tool.order.public.js.evaluate.l168.t0")
|
||||
});
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
if (!this.goodsEvalList[i].content.trim().length) {
|
||||
this.$util.showToast({
|
||||
title: $lang("tool.order.public.js.evaluate.l168.t0")
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
let goodsEvaluate = JSON.stringify(this.goodsEvalList)
|
||||
let data = {
|
||||
order_id: this.orderId,
|
||||
goods_evaluate: goodsEvaluate,
|
||||
};
|
||||
if (!this.isEvaluate) {
|
||||
data.order_no = this.orderNo;
|
||||
data.member_name = this.memberInfo.nickname;
|
||||
data.member_headimg = this.memberInfo.headimg;
|
||||
data.is_anonymous = this.isAnonymous;
|
||||
}
|
||||
if (this.flag) return;
|
||||
this.flag = true;
|
||||
this.$api.sendRequest({
|
||||
url: this.isEvaluate ? '/api/goodsevaluate/again' : '/api/goodsevaluate/add',
|
||||
data: data,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.$util.showToast({
|
||||
title: $lang("tool.order.public.js.evaluate.l200.t0")
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list', {}, "redirectTo");
|
||||
}, 1000);
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: res.message
|
||||
});
|
||||
this.flag = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.goodsList[index].sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
getEvaluateConfig() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/goodsevaluate/config',
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
var data = res.data;
|
||||
this.evaluateConfig = data;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1,30 +1,30 @@
|
||||
export default {
|
||||
methods: {
|
||||
/**
|
||||
* 撤销退款申请
|
||||
* @param {Object} order_goods_id
|
||||
* @param {Object} callback
|
||||
*/
|
||||
cancleRefund(order_goods_id, callback) {
|
||||
uni.showModal({
|
||||
content: '撤销之后本次申请将会关闭,如后续仍有问题可再次发起申请。',
|
||||
cancelText: '暂不撤销',
|
||||
cancelColor: '#898989',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/cancel',
|
||||
data: {
|
||||
order_goods_id
|
||||
},
|
||||
success: res => {
|
||||
typeof callback == 'function' && callback(res);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
export default {
|
||||
methods: {
|
||||
/**
|
||||
* 撤销退款申请
|
||||
* @param {Object} order_goods_id
|
||||
* @param {Object} callback
|
||||
*/
|
||||
cancleRefund(order_goods_id, callback) {
|
||||
uni.showModal({
|
||||
content: $lang('order.public.js.refund_method.l10'),
|
||||
cancelText: $lang('order.public.js.refund_method.l11'),
|
||||
cancelColor: '#898989',
|
||||
success: res => {
|
||||
if (res.confirm) {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/cancel',
|
||||
data: {
|
||||
order_goods_id
|
||||
},
|
||||
success: res => {
|
||||
typeof callback == 'function' && callback(res);
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,300 +1,300 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<scroll-view scroll-y="true" class="refund-container">
|
||||
<view class="goods-wrap">
|
||||
<view class="goods-img">
|
||||
<image :src="$util.img(refund_data.order_goods_info.sku_image, { size: 'mid' })" @error="refund_data.order_goods_info.sku_image = $util.getDefaultImage().goods" mode="aspectFill" :lazy-load="true" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">{{ refund_data.order_goods_info.sku_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="refund-option" v-show="!refund_type">
|
||||
<view class="option-item" @click="selectRefundType(1)">
|
||||
<view>
|
||||
<text>退款无需退货</text>
|
||||
<text class="font-size-goods-tag color-tip">没收到货,或与卖家协商同意无需退货只退款</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<view class="option-item" @click="selectRefundType(2)" v-if="refund_data.refund_type.length == 2">
|
||||
<view>
|
||||
<text>退货退款</text>
|
||||
<text class="font-size-goods-tag color-tip">已收到货,需退还收到的货物</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-show="refund_type">
|
||||
<view class="refund-form">
|
||||
<view class="item-wrap" @click="openPopup('refundReasonPopup')">
|
||||
<view class="label">退款原因:</view>
|
||||
<view class="cont reason">
|
||||
<text class="color-tip" v-if="!refund_reason.length">请选择</text>
|
||||
<text class="color-tip" v-else>{{ refund_reason }}</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<view class="item-wrap">
|
||||
<view class="label">退款金额:</view>
|
||||
<view class="cont color-base-text">{{ $lang('common.currencySymbol') }}{{ refund_data.refund_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="refund-form">
|
||||
<view class="item-wrap"><view class="label active">退款说明</view></view>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<textarea
|
||||
v-if="!showText"
|
||||
class="newText"
|
||||
placeholder="请输入退款说明(选填)"
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<textarea
|
||||
class="newText"
|
||||
placeholder="请输入退款说明(选填)"
|
||||
@blur="textBlur()"
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
<!-- <view class="sub-btn color-base-bg" :class="{ 'safe-area': isIphoneX }" @click="submit">{{ $lang('common.submit') }}</view> -->
|
||||
<view class="sub-btn" :class="{ 'safe-area': isIphoneX }" @click="submit">
|
||||
<button type="primary">{{ $lang('common.submit') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="refundReasonPopup" type="bottom" @change="change()">
|
||||
<view class="refund-reason-popup popup">
|
||||
<view class="popup-header">
|
||||
<view><text class="tit">退款原因</text></view>
|
||||
<view class="align-right" @click="closePopup('refundReasonPopup')"><text class="iconfont icon-close"></text></view>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<scroll-view scroll-y="true" class="scroll-view" :class="{ 'safe-area': isIphoneX }">
|
||||
<view class="reason-list">
|
||||
<view class="item" v-for="(item, index) in refund_data.refund_reason_type" :key="index" @click="changeReason(item)">
|
||||
<view class="reason">{{ item }}</view>
|
||||
<view class="iconfont" :class="refund_reason == item ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="popup-footer" :class="{ 'bottom-safe-area': isIphoneX }">
|
||||
<view class="confirm-btn color-base-bg" @click="closePopup('refundReasonPopup')">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</scroll-view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
order_goods_id: '',
|
||||
refund_type: '',
|
||||
refund_reason: '',
|
||||
refund_remark: '',
|
||||
isIphoneX: false,
|
||||
refund_data: {
|
||||
refund_type: [],
|
||||
order_goods_info: {
|
||||
sku_image: ''
|
||||
}
|
||||
},
|
||||
isSub: false,
|
||||
showText: false //是否展示退款说明,解决原生小程序textarea层级过高 popup不能遮挡的问题
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_goods_id) this.order_goods_id = option.order_goods_id;
|
||||
},
|
||||
onShow() {
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (this.storeToken) {
|
||||
this.getRefundData();
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 显示弹出层
|
||||
* @param {Object} ref
|
||||
*/
|
||||
openPopup(ref) {
|
||||
this.$refs[ref].open();
|
||||
},
|
||||
/**
|
||||
* 关闭弹出层
|
||||
* @param {Object} ref
|
||||
*/
|
||||
closePopup(ref) {
|
||||
this.$refs[ref].close();
|
||||
},
|
||||
textBlur() {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 0
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 选择退款方式
|
||||
* @param {Object} type
|
||||
*/
|
||||
selectRefundType(type) {
|
||||
this.refund_type = type;
|
||||
},
|
||||
getRefundData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refundData',
|
||||
data: {
|
||||
order_goods_id: this.order_goods_id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.refund_data = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({ title: '未获取到该订单项退款信息' });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
if (this.verify()) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
// #ifdef MP
|
||||
this.subscribeMessage(() => {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refund',
|
||||
data: {
|
||||
order_goods_ids: this.order_goods_id,
|
||||
refund_type: this.refund_type,
|
||||
refund_reason: this.refund_reason,
|
||||
refund_remark: this.refund_remark
|
||||
},
|
||||
success: res => {
|
||||
this.$util.showToast({ title: res.message });
|
||||
if (res.code >= 0) {
|
||||
this.$util.redirectTo('/pages_tool/order/activist', {}, 'redirectTo');
|
||||
} else {
|
||||
this.isSub = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refund',
|
||||
data: {
|
||||
order_goods_ids: this.order_goods_id,
|
||||
refund_type: this.refund_type,
|
||||
refund_reason: this.refund_reason,
|
||||
refund_remark: this.refund_remark
|
||||
},
|
||||
success: res => {
|
||||
this.$util.showToast({ title: res.message });
|
||||
if (res.code >= 0) {
|
||||
this.$util.redirectTo('/pages_tool/order/activist', {}, 'redirectTo');
|
||||
} else {
|
||||
this.isSub = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
verify() {
|
||||
if (this.refund_reason == '') {
|
||||
this.$util.showToast({ title: '请选择退款原因' });
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
changeReason(refund_reason) {
|
||||
this.refund_reason = refund_reason;
|
||||
},
|
||||
change(e) {
|
||||
if (e) this.showText = e.show;
|
||||
},
|
||||
/**
|
||||
* 微信订阅消息
|
||||
*/
|
||||
subscribeMessage(callback){
|
||||
this.$api.sendRequest({
|
||||
url: '/weapp/api/weapp/messagetmplids',
|
||||
data: {
|
||||
keywords: 'ORDER_REFUND_AGREE,ORDER_REFUND_REFUSE'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data.length) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: res.data,
|
||||
fail: (res) => {
|
||||
},
|
||||
complete: ()=> {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/refund.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
::v-deep .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
::v-deep .uni-popup {
|
||||
z-index: 8;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<scroll-view scroll-y="true" class="refund-container">
|
||||
<view class="goods-wrap">
|
||||
<view class="goods-img">
|
||||
<image :src="$util.img(refund_data.order_goods_info.sku_image, { size: 'mid' })" @error="refund_data.order_goods_info.sku_image = $util.getDefaultImage().goods" mode="aspectFill" :lazy-load="true" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">{{ refund_data.order_goods_info.sku_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="refund-option" v-show="!refund_type">
|
||||
<view class="option-item" @click="selectRefundType(1)">
|
||||
<view>
|
||||
<text>{{ $lang("tool.order.refund.l17.t0") }}</text>
|
||||
<text class="font-size-goods-tag color-tip">{{ $lang("tool.order.refund.l18.t0") }}</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<view class="option-item" @click="selectRefundType(2)" v-if="refund_data.refund_type.length == 2">
|
||||
<view>
|
||||
<text>{{ $lang("tool.order.refund.l24.t0") }}</text>
|
||||
<text class="font-size-goods-tag color-tip">{{ $lang("tool.order.refund.l25.t0") }}</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-show="refund_type">
|
||||
<view class="refund-form">
|
||||
<view class="item-wrap" @click="openPopup('refundReasonPopup')">
|
||||
<view class="label">{{ $lang("tool.order.refund.l34.t0") }}</view>
|
||||
<view class="cont reason">
|
||||
<text class="color-tip" v-if="!refund_reason.length">{{ $lang("common.ns-form.l37.t0") }}</text>
|
||||
<text class="color-tip" v-else>{{ refund_reason }}</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<view class="item-wrap">
|
||||
<view class="label">{{ $lang("tool.order.refund.l42.t0") }}</view>
|
||||
<view class="cont color-base-text">{{ $lang('common.currency_symbol') }}{{ refund_data.refund_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="refund-form">
|
||||
<view class="item-wrap"><view class="label active">{{ $lang("tool.order.refund.l48.t0") }}</view></view>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<textarea
|
||||
v-if="!showText"
|
||||
class="newText"
|
||||
placeholder=$lang("tool.order.refund.l54.t0")
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<textarea
|
||||
class="newText"
|
||||
placeholder=$lang("tool.order.refund.l54.t0")
|
||||
@blur="textBlur()"
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
<!-- <view class="sub-btn color-base-bg" :class="{ 'safe-area': isIphoneX }" @click="submit">{{ $lang('common.submit') }}</view> -->
|
||||
<view class="sub-btn" :class="{ 'safe-area': isIphoneX }" @click="submit">
|
||||
<button type="primary">{{ $lang('common.submit') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="refundReasonPopup" type="bottom" @change="change()">
|
||||
<view class="refund-reason-popup popup">
|
||||
<view class="popup-header">
|
||||
<view><text class="tit">{{ $lang("tool.order.refund.l81.t0") }}</text></view>
|
||||
<view class="align-right" @click="closePopup('refundReasonPopup')"><text class="iconfont icon-close"></text></view>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<scroll-view scroll-y="true" class="scroll-view" :class="{ 'safe-area': isIphoneX }">
|
||||
<view class="reason-list">
|
||||
<view class="item" v-for="(item, index) in refund_data.refund_reason_type" :key="index" @click="changeReason(item)">
|
||||
<view class="reason">{{ item }}</view>
|
||||
<view class="iconfont" :class="refund_reason == item ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="popup-footer" :class="{ 'bottom-safe-area': isIphoneX }">
|
||||
<view class="confirm-btn color-base-bg" @click="closePopup('refundReasonPopup')">{{ $lang("common.ns-goods-sku.ns-goods-sku-category.l76.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</scroll-view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
order_goods_id: '',
|
||||
refund_type: '',
|
||||
refund_reason: '',
|
||||
refund_remark: '',
|
||||
isIphoneX: false,
|
||||
refund_data: {
|
||||
refund_type: [],
|
||||
order_goods_info: {
|
||||
sku_image: ''
|
||||
}
|
||||
},
|
||||
isSub: false,
|
||||
showText: false //是否展示退款说明,解决原生小程序textarea层级过高 popup不能遮挡的问题
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_goods_id) this.order_goods_id = option.order_goods_id;
|
||||
},
|
||||
onShow() {
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (this.storeToken) {
|
||||
this.getRefundData();
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 显示弹出层
|
||||
* @param {Object} ref
|
||||
*/
|
||||
openPopup(ref) {
|
||||
this.$refs[ref].open();
|
||||
},
|
||||
/**
|
||||
* 关闭弹出层
|
||||
* @param {Object} ref
|
||||
*/
|
||||
closePopup(ref) {
|
||||
this.$refs[ref].close();
|
||||
},
|
||||
textBlur() {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 0
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 选择退款方式
|
||||
* @param {Object} type
|
||||
*/
|
||||
selectRefundType(type) {
|
||||
this.refund_type = type;
|
||||
},
|
||||
getRefundData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refundData',
|
||||
data: {
|
||||
order_goods_id: this.order_goods_id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.refund_data = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({ title: $lang('tool.order.refund.l175.t0') });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
if (this.verify()) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
// #ifdef MP
|
||||
this.subscribeMessage(() => {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refund',
|
||||
data: {
|
||||
order_goods_ids: this.order_goods_id,
|
||||
refund_type: this.refund_type,
|
||||
refund_reason: this.refund_reason,
|
||||
refund_remark: this.refund_remark
|
||||
},
|
||||
success: res => {
|
||||
this.$util.showToast({ title: res.message });
|
||||
if (res.code >= 0) {
|
||||
this.$util.redirectTo('/pages_tool/order/activist', {}, 'redirectTo');
|
||||
} else {
|
||||
this.isSub = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refund',
|
||||
data: {
|
||||
order_goods_ids: this.order_goods_id,
|
||||
refund_type: this.refund_type,
|
||||
refund_reason: this.refund_reason,
|
||||
refund_remark: this.refund_remark
|
||||
},
|
||||
success: res => {
|
||||
this.$util.showToast({ title: res.message });
|
||||
if (res.code >= 0) {
|
||||
this.$util.redirectTo('/pages_tool/order/activist', {}, 'redirectTo');
|
||||
} else {
|
||||
this.isSub = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
verify() {
|
||||
if (this.refund_reason == '') {
|
||||
this.$util.showToast({ title: $lang('tool.order.refund.l242.t0') });
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
changeReason(refund_reason) {
|
||||
this.refund_reason = refund_reason;
|
||||
},
|
||||
change(e) {
|
||||
if (e) this.showText = e.show;
|
||||
},
|
||||
/**
|
||||
* 微信订阅消息
|
||||
*/
|
||||
subscribeMessage(callback){
|
||||
this.$api.sendRequest({
|
||||
url: '/weapp/api/weapp/messagetmplids',
|
||||
data: {
|
||||
keywords: 'ORDER_REFUND_AGREE,ORDER_REFUND_REFUSE'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data.length) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: res.data,
|
||||
fail: (res) => {
|
||||
},
|
||||
complete: ()=> {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/refund.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
::v-deep .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
::v-deep .uni-popup {
|
||||
z-index: 8;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,306 +1,306 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<scroll-view scroll-y="true" class="refund-container">
|
||||
<view class="goods-wrap" v-for="(item,index) in refund_data.order_goods_info" :key="index">
|
||||
<view class="goods-img">
|
||||
<image :src="$util.img(item.sku_image, { size: 'mid' })" @error="item.sku_image = $util.getDefaultImage().goods" mode="aspectFill" :lazy-load="true" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">{{ item.sku_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
|
||||
<view class="refund-form">
|
||||
<view class="item-wrap" @click="openPopup('refundReasonPopup')">
|
||||
<view class="label">退款原因:</view>
|
||||
<view class="cont reason">
|
||||
<text class="color-tip" v-if="!refund_reason.length">请选择</text>
|
||||
<text class="color-tip" v-else>{{ refund_reason }}</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<view class="item-wrap">
|
||||
<view class="label">退款方式:</view>
|
||||
<view class="cont color-base-text" v-if="refund_type == 1">退款无需退货</view>
|
||||
<view class="cont color-base-text" v-else>退货退款</view>
|
||||
</view>
|
||||
<view class="item-wrap">
|
||||
<view class="label">退款金额:</view>
|
||||
<view class="cont color-base-text">{{ $lang('common.currencySymbol') }}{{ refund_data.refund_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="refund-form">
|
||||
<view class="item-wrap"><view class="label active">退款说明</view></view>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<textarea
|
||||
v-if="!showText"
|
||||
class="newText"
|
||||
placeholder="请输入退款说明(选填)"
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<textarea
|
||||
class="newText"
|
||||
placeholder="请输入退款说明(选填)"
|
||||
@blur="textBlur()"
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
<!-- <view class="sub-btn color-base-bg" :class="{ 'safe-area': isIphoneX }" @click="submit">{{ $lang('common.submit') }}</view> -->
|
||||
<view class="sub-btn" :class="{ 'safe-area': isIphoneX }" @click="submit">
|
||||
<!-- <button type="primary">提交</button> -->
|
||||
<button type="primary">{{ $lang('common.submit') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="refundReasonPopup" type="bottom" @change="change()">
|
||||
<view class="refund-reason-popup popup">
|
||||
<view class="popup-header">
|
||||
<view><text class="tit">退款原因</text></view>
|
||||
<view class="align-right" @click="closePopup('refundReasonPopup')"><text class="iconfont icon-close"></text></view>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<scroll-view scroll-y="true" class="scroll-view" :class="{ 'safe-area': isIphoneX }">
|
||||
<view class="reason-list">
|
||||
<view class="item" v-for="(item, index) in refund_data.refund_reason_type" :key="index" @click="changeReason(item)">
|
||||
<view class="reason">{{ item }}</view>
|
||||
<view class="iconfont" :class="refund_reason == item ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="popup-footer" :class="{ 'bottom-safe-area': isIphoneX }">
|
||||
<view class="confirm-btn color-base-bg" @click="closePopup('refundReasonPopup')">确定</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</scroll-view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
order_goods_id: '',
|
||||
refund_type: '',
|
||||
refund_reason: '',
|
||||
refund_remark: '',
|
||||
isIphoneX: false,
|
||||
refund_data: {
|
||||
refund_type: [],
|
||||
order_goods_info: {
|
||||
sku_image: ''
|
||||
}
|
||||
},
|
||||
isSub: false,
|
||||
showText: false //是否展示退款说明,解决原生小程序textarea层级过高 popup不能遮挡的问题
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_goods_id) this.order_goods_id = option.order_goods_id;
|
||||
|
||||
if (option.refund_type) this.refund_type = option.refund_type;
|
||||
},
|
||||
onShow() {
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (this.storeToken) {
|
||||
this.getRefundData();
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 显示弹出层
|
||||
* @param {Object} ref
|
||||
*/
|
||||
openPopup(ref) {
|
||||
this.$refs[ref].open();
|
||||
},
|
||||
/**
|
||||
* 关闭弹出层
|
||||
* @param {Object} ref
|
||||
*/
|
||||
closePopup(ref) {
|
||||
this.$refs[ref].close();
|
||||
},
|
||||
textBlur() {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 0
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 选择退款方式
|
||||
* @param {Object} type
|
||||
*/
|
||||
selectRefundType(type) {
|
||||
this.refund_type = type;
|
||||
},
|
||||
getRefundData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refundDataBatch',
|
||||
data: {
|
||||
order_goods_ids: this.order_goods_id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.refund_data = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({ title: '未获取到该订单项退款信息' });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
if (this.verify()) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
// #ifdef MP
|
||||
this.subscribeMessage(() => {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refund',
|
||||
data: {
|
||||
order_goods_ids: this.order_goods_id,
|
||||
refund_type: this.refund_type,
|
||||
refund_reason: this.refund_reason,
|
||||
refund_remark: this.refund_remark
|
||||
},
|
||||
success: res => {
|
||||
this.$util.showToast({ title: res.message });
|
||||
if (res.code >= 0) {
|
||||
uni.removeStorage({
|
||||
key:'refund_goods_data',
|
||||
success:res=>{
|
||||
this.$util.redirectTo('/pages_tool/order/activist');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.isSub = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refund',
|
||||
data: {
|
||||
order_goods_ids: this.order_goods_id,
|
||||
refund_type: this.refund_type,
|
||||
refund_reason: this.refund_reason,
|
||||
refund_remark: this.refund_remark
|
||||
},
|
||||
success: res => {
|
||||
this.$util.showToast({ title: res.message });
|
||||
if (res.code >= 0) {
|
||||
uni.removeStorage({
|
||||
key:'refund_goods_data',
|
||||
success:res=>{
|
||||
this.$util.redirectTo('/pages_tool/order/activist');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.isSub = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
verify() {
|
||||
if (this.refund_reason == '') {
|
||||
this.$util.showToast({ title: '请选择退款原因' });
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
changeReason(refund_reason) {
|
||||
this.refund_reason = refund_reason;
|
||||
},
|
||||
change(e) {
|
||||
if (e) this.showText = e.show;
|
||||
},
|
||||
/**
|
||||
* 微信订阅消息
|
||||
*/
|
||||
subscribeMessage(callback){
|
||||
this.$api.sendRequest({
|
||||
url: '/weapp/api/weapp/messagetmplids',
|
||||
data: {
|
||||
keywords: 'ORDER_REFUND_AGREE,ORDER_REFUND_REFUSE'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data.length) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: res.data,
|
||||
fail: (res) => {
|
||||
},
|
||||
complete: ()=> {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/refund.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
::v-deep .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
::v-deep .uni-popup {
|
||||
z-index: 8;
|
||||
}
|
||||
.sub-btn{
|
||||
padding-top: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<scroll-view scroll-y="true" class="refund-container">
|
||||
<view class="goods-wrap" v-for="(item,index) in refund_data.order_goods_info" :key="index">
|
||||
<view class="goods-img">
|
||||
<image :src="$util.img(item.sku_image, { size: 'mid' })" @error="item.sku_image = $util.getDefaultImage().goods" mode="aspectFill" :lazy-load="true" show-menu-by-longpress/>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name">{{ item.sku_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view>
|
||||
|
||||
<view class="refund-form">
|
||||
<view class="item-wrap" @click="openPopup('refundReasonPopup')">
|
||||
<view class="label">{{ $lang("tool.order.refund.l34.t0") }}</view>
|
||||
<view class="cont reason">
|
||||
<text class="color-tip" v-if="!refund_reason.length">{{ $lang("common.ns-form.l37.t0") }}</text>
|
||||
<text class="color-tip" v-else>{{ refund_reason }}</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<view class="item-wrap">
|
||||
<view class="label">{{ $lang("tool.order.refund_batch.l26.t0") }}</view>
|
||||
<view class="cont color-base-text" v-if="refund_type == 1">{{ $lang("tool.order.refund.l17.t0") }}</view>
|
||||
<view class="cont color-base-text" v-else>{{ $lang("tool.order.refund.l24.t0") }}</view>
|
||||
</view>
|
||||
<view class="item-wrap">
|
||||
<view class="label">{{ $lang("tool.order.refund.l42.t0") }}</view>
|
||||
<view class="cont color-base-text">{{ $lang('common.currency_symbol') }}{{ refund_data.refund_money }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="refund-form">
|
||||
<view class="item-wrap"><view class="label active">{{ $lang("tool.order.refund.l48.t0") }}</view></view>
|
||||
|
||||
<!-- #ifdef MP-WEIXIN -->
|
||||
<textarea
|
||||
v-if="!showText"
|
||||
class="newText"
|
||||
placeholder=$lang("tool.order.refund.l54.t0")
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
<!-- #ifdef H5 -->
|
||||
<textarea
|
||||
class="newText"
|
||||
placeholder=$lang("tool.order.refund.l54.t0")
|
||||
@blur="textBlur()"
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
v-model="refund_remark"
|
||||
/>
|
||||
<!-- #endif -->
|
||||
</view>
|
||||
|
||||
<!-- <view class="sub-btn color-base-bg" :class="{ 'safe-area': isIphoneX }" @click="submit">{{ $lang('common.submit') }}</view> -->
|
||||
<view class="sub-btn" :class="{ 'safe-area': isIphoneX }" @click="submit">
|
||||
<!-- <button type="primary">{{ $lang("diy.diy-form.l142.t0") }}</button> -->
|
||||
<button type="primary">{{ $lang('common.submit') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<uni-popup ref="refundReasonPopup" type="bottom" @change="change()">
|
||||
<view class="refund-reason-popup popup">
|
||||
<view class="popup-header">
|
||||
<view><text class="tit">{{ $lang("tool.order.refund.l81.t0") }}</text></view>
|
||||
<view class="align-right" @click="closePopup('refundReasonPopup')"><text class="iconfont icon-close"></text></view>
|
||||
</view>
|
||||
<view class="popup-body">
|
||||
<scroll-view scroll-y="true" class="scroll-view" :class="{ 'safe-area': isIphoneX }">
|
||||
<view class="reason-list">
|
||||
<view class="item" v-for="(item, index) in refund_data.refund_reason_type" :key="index" @click="changeReason(item)">
|
||||
<view class="reason">{{ item }}</view>
|
||||
<view class="iconfont" :class="refund_reason == item ? 'icon-yuan_checked color-base-text' : 'icon-yuan_checkbox'"></view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="popup-footer" :class="{ 'bottom-safe-area': isIphoneX }">
|
||||
<view class="confirm-btn color-base-bg" @click="closePopup('refundReasonPopup')">{{ $lang("common.ns-goods-sku.ns-goods-sku-category.l76.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
</scroll-view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
order_goods_id: '',
|
||||
refund_type: '',
|
||||
refund_reason: '',
|
||||
refund_remark: '',
|
||||
isIphoneX: false,
|
||||
refund_data: {
|
||||
refund_type: [],
|
||||
order_goods_info: {
|
||||
sku_image: ''
|
||||
}
|
||||
},
|
||||
isSub: false,
|
||||
showText: false //是否展示退款说明,解决原生小程序textarea层级过高 popup不能遮挡的问题
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_goods_id) this.order_goods_id = option.order_goods_id;
|
||||
|
||||
if (option.refund_type) this.refund_type = option.refund_type;
|
||||
},
|
||||
onShow() {
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (this.storeToken) {
|
||||
this.getRefundData();
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 显示弹出层
|
||||
* @param {Object} ref
|
||||
*/
|
||||
openPopup(ref) {
|
||||
this.$refs[ref].open();
|
||||
},
|
||||
/**
|
||||
* 关闭弹出层
|
||||
* @param {Object} ref
|
||||
*/
|
||||
closePopup(ref) {
|
||||
this.$refs[ref].close();
|
||||
},
|
||||
textBlur() {
|
||||
uni.pageScrollTo({
|
||||
scrollTop: 0,
|
||||
duration: 0
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 选择退款方式
|
||||
* @param {Object} type
|
||||
*/
|
||||
selectRefundType(type) {
|
||||
this.refund_type = type;
|
||||
},
|
||||
getRefundData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refundDataBatch',
|
||||
data: {
|
||||
order_goods_ids: this.order_goods_id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.refund_data = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({ title: $lang('tool.order.refund.l175.t0') });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
submit() {
|
||||
if (this.verify()) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
|
||||
// #ifdef MP
|
||||
this.subscribeMessage(() => {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refund',
|
||||
data: {
|
||||
order_goods_ids: this.order_goods_id,
|
||||
refund_type: this.refund_type,
|
||||
refund_reason: this.refund_reason,
|
||||
refund_remark: this.refund_remark
|
||||
},
|
||||
success: res => {
|
||||
this.$util.showToast({ title: res.message });
|
||||
if (res.code >= 0) {
|
||||
uni.removeStorage({
|
||||
key:'refund_goods_data',
|
||||
success:res=>{
|
||||
this.$util.redirectTo('/pages_tool/order/activist');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.isSub = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
})
|
||||
// #endif
|
||||
|
||||
// #ifndef MP-WEIXIN
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/refund',
|
||||
data: {
|
||||
order_goods_ids: this.order_goods_id,
|
||||
refund_type: this.refund_type,
|
||||
refund_reason: this.refund_reason,
|
||||
refund_remark: this.refund_remark
|
||||
},
|
||||
success: res => {
|
||||
this.$util.showToast({ title: res.message });
|
||||
if (res.code >= 0) {
|
||||
uni.removeStorage({
|
||||
key:'refund_goods_data',
|
||||
success:res=>{
|
||||
this.$util.redirectTo('/pages_tool/order/activist');
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.isSub = false;
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
this.isSub = false;
|
||||
}
|
||||
});
|
||||
// #endif
|
||||
}
|
||||
},
|
||||
verify() {
|
||||
if (this.refund_reason == '') {
|
||||
this.$util.showToast({ title: $lang('tool.order.refund.l242.t0') });
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
changeReason(refund_reason) {
|
||||
this.refund_reason = refund_reason;
|
||||
},
|
||||
change(e) {
|
||||
if (e) this.showText = e.show;
|
||||
},
|
||||
/**
|
||||
* 微信订阅消息
|
||||
*/
|
||||
subscribeMessage(callback){
|
||||
this.$api.sendRequest({
|
||||
url: '/weapp/api/weapp/messagetmplids',
|
||||
data: {
|
||||
keywords: 'ORDER_REFUND_AGREE,ORDER_REFUND_REFUSE'
|
||||
},
|
||||
success: res => {
|
||||
if (res.code == 0 && res.data.length) {
|
||||
uni.requestSubscribeMessage({
|
||||
tmplIds: res.data,
|
||||
fail: (res) => {
|
||||
},
|
||||
complete: ()=> {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
callback();
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/refund.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
::v-deep .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
::v-deep .uni-popup {
|
||||
z-index: 8;
|
||||
}
|
||||
.sub-btn{
|
||||
padding-top: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,272 +1,272 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="true" class="detail-container" :class="{ 'safe-area': isIphoneX }" v-if="detail">
|
||||
<view v-show="action == ''">
|
||||
<view class="status-wrap">
|
||||
<view class="status-name">{{ detail.refund_status_name }}</view>
|
||||
<view class="refund-explain" v-if="detail.refund_status == 1">
|
||||
<view class="font-size-goods-tag color-tip">如果商家拒绝,你可重新发起申请</view>
|
||||
<view class="font-size-goods-tag color-tip">如果商家同意,将通过申请并退款给你</view>
|
||||
<!-- <view class="font-size-goods-tag color-tip">如果商家逾期未处理,平台将自动通过申请并退款给你</view> -->
|
||||
</view>
|
||||
<view class="refund-explain" v-if="detail.refund_status == 5">
|
||||
<view class="font-size-goods-tag color-tip">如果商家确认收货将会退款给你</view>
|
||||
<view class="font-size-goods-tag color-tip">如果商家拒绝收货,该次退款将会关闭,你可以重新发起退款</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="history-wrap" @click="switchAction('consultrecord')">
|
||||
<view>协商记录</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
|
||||
<view class="refund-address-wrap" v-if="detail.refund_status == 4">
|
||||
<view class="header">退货地址</view>
|
||||
<view>
|
||||
<text>收货人:{{ detail.shop_contacts }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>联系方式:{{ detail.shop_mobile }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="address">退货地址:{{ detail.shop_address }}</text>
|
||||
<view class="copy" @click="$util.copy(detail.shop_address)">复制</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="refund-info">
|
||||
<view class="header">退款信息</view>
|
||||
<view class="body">
|
||||
<!-- 商品信息 -->
|
||||
<view class="goods-wrap">
|
||||
<view class="goods-img" @click="refundDetail(detail)">
|
||||
<image :src="$util.img(detail.sku_image, { size: 'mid' })" @error="imageError()" mode="aspectFill" :lazy-load="true" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name" @click="refundDetail(detail)">{{ detail.sku_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 退款信息 -->
|
||||
<view class="info">
|
||||
<view class="cell">退款方式:{{ detail.refund_type == 1 ? '仅退款' : '退款退货' }}</view>
|
||||
<view class="cell" v-if="detail.refund_status == 3">退款途径:{{ detail.refund_money_type == 1 ? '原路退款' : detail.refund_money_type == 2 ? '线下退款' : '退款到余额' }}</view>
|
||||
<view class="cell">退款原因:{{ detail.refund_reason }}</view>
|
||||
<view class="cell" v-if="detail.refund_status == 3 && detail.refund_real_money>0">退款金额:{{ $lang('common.currencySymbol') }}{{ detail.refund_real_money }}</view>
|
||||
<view class="cell" v-else-if="detail.refund_apply_money>0">退款金额:{{ $lang('common.currencySymbol') }}{{ detail.refund_apply_money }}</view>
|
||||
<view class="cell">退款编号:{{ detail.refund_no }}</view>
|
||||
<view class="cell">申请时间:{{ $util.timeStampTurnTime(detail.refund_action_time) }}</view>
|
||||
<view class="cell" v-if="detail.refund_time">退款时间:{{ $util.timeStampTurnTime(detail.refund_time) }}</view>
|
||||
<view class="cell" v-if="detail.refund_remark != ''">退款说明:{{ detail.refund_remark }}</view>
|
||||
<view class="cell" v-if="detail.use_point>0">退款积分:{{ detail.use_point }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="action" :class="{ 'bottom-safe-area': isIphoneX }" v-if="detail.refund_action.length">
|
||||
<view class="order-box-btn" v-for="(actionItem, actionIndex) in detail.refund_action" :key="actionIndex" @click="refundAction(actionItem.event)">
|
||||
{{ actionItem.title }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-show="action == 'returngoods'">
|
||||
<view class="return-goods-container">
|
||||
<view class="form-wrap">
|
||||
<view class="item">
|
||||
<view class="label">物流公司</view>
|
||||
<view class="cont">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入物流公司"
|
||||
class="input"
|
||||
placeholder-class="input-placeholder color-tip"
|
||||
v-model="formData.refund_delivery_name"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label">物流单号</view>
|
||||
<view class="cont">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入物流单号"
|
||||
class="input"
|
||||
placeholder-class="input-placeholder color-tip"
|
||||
v-model="formData.refund_delivery_no"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label">物流说明</view>
|
||||
<view class="cont">
|
||||
<textarea
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
class="textarea"
|
||||
placeholder="选填"
|
||||
v-model="formData.refund_delivery_remark"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button type="primary" class="sub-btn" @click="refurnGoods">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-show="action == 'consultrecord'">
|
||||
<view class="record-wrap">
|
||||
<view class="record-item" :class="logItem.action_way == 1 ? 'buyer' : ''" v-for="(logItem, logIndex) in detail.refund_log_list" :key="logIndex">
|
||||
<view class="cont">
|
||||
<view class="head">
|
||||
<text>{{ logItem.action_way == 1 ? '买家' : '卖家' }}</text>
|
||||
<text class="time">{{ $util.timeStampTurnTime(logItem.action_time) }}</text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="refund-action">{{ logItem.action }}</view>
|
||||
<view class="desc" v-if="logItem.desc != ''">{{ logItem.desc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="empty-box"></view>
|
||||
</view>
|
||||
<view class="history-bottom" :class="{ 'bottom-safe-area': isIphoneX }">
|
||||
<!-- <ns-contact :niushop="{order_id: detail.order_id}">
|
||||
<view>
|
||||
<text class="iconfont icon-ziyuan"></text>
|
||||
<text>联系客服</text>
|
||||
</view>
|
||||
</ns-contact> -->
|
||||
<view @click="switchAction('')">返回详情</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import refundMethod from './public/js/refundMethod.js';
|
||||
import validate from 'common/js/validate.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
order_goods_id: '',
|
||||
detail: {
|
||||
refund_action: []
|
||||
},
|
||||
isIphoneX: false,
|
||||
action: '',
|
||||
formData: {
|
||||
refund_delivery_name: '',
|
||||
refund_delivery_no: '',
|
||||
refund_delivery_remark: ''
|
||||
},
|
||||
isSub: false
|
||||
};
|
||||
},
|
||||
mixins: [refundMethod],
|
||||
onLoad(option) {
|
||||
if (option.order_goods_id) this.order_goods_id = option.order_goods_id;
|
||||
if (option.action) this.action = option.action;
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
this.getRefundDetail();
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund_detail?order_goods_id=' + this.order_goods_id });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getRefundDetail() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/detail',
|
||||
data: {
|
||||
order_goods_id: this.order_goods_id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.detail = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({ title: '未获取到该订单项退款信息' });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
refundAction(event) {
|
||||
switch (event) {
|
||||
case 'orderRefundCancel':
|
||||
this.cancleRefund(this.detail.order_goods_id, res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({ title: '撤销成功' });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'orderRefundDelivery':
|
||||
this.action = 'returngoods';
|
||||
break;
|
||||
case 'orderRefundAsk':
|
||||
this.$util.redirectTo('/pages_tool/order/refund', { order_goods_id: this.detail.order_goods_id });
|
||||
break;
|
||||
}
|
||||
},
|
||||
refurnGoods() {
|
||||
var rule = [
|
||||
{ name: 'refund_delivery_name', checkType: 'required', errorMsg: '请输入物流公司' },
|
||||
{ name: 'refund_delivery_no', checkType: 'required', errorMsg: '请输入物流单号' }
|
||||
];
|
||||
this.formData.order_goods_id = this.order_goods_id;
|
||||
var checkRes = validate.check(this.formData, rule);
|
||||
if (checkRes) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/delivery',
|
||||
data: this.formData,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.action = '';
|
||||
this.getRefundDetail();
|
||||
} else {
|
||||
this.$util.showToast({ title: res.message });
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({ title: validate.error });
|
||||
return false;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 切换操作
|
||||
*/
|
||||
switchAction(action) {
|
||||
this.action = action;
|
||||
},
|
||||
imageError() {
|
||||
this.detail.sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
refundDetail(e) {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: e.goods_id
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/refund_detail.scss';
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="true" class="detail-container" :class="{ 'safe-area': isIphoneX }" v-if="detail">
|
||||
<view v-show="action == ''">
|
||||
<view class="status-wrap">
|
||||
<view class="status-name">{{ detail.refund_status_name }}</view>
|
||||
<view class="refund-explain" v-if="detail.refund_status == 1">
|
||||
<view class="font-size-goods-tag color-tip">{{ $lang("tool.order.refund_detail.l8.t0") }}</view>
|
||||
<view class="font-size-goods-tag color-tip">{{ $lang("tool.order.refund_detail.l9.t0") }}</view>
|
||||
<!-- <view class="font-size-goods-tag color-tip">{{ $lang("tool.order.refund_detail.l10.t0") }}</view> -->
|
||||
</view>
|
||||
<view class="refund-explain" v-if="detail.refund_status == 5">
|
||||
<view class="font-size-goods-tag color-tip">{{ $lang("tool.order.refund_detail.l13.t0") }}</view>
|
||||
<view class="font-size-goods-tag color-tip">{{ $lang("tool.order.refund_detail.l14.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="history-wrap" @click="switchAction('consultrecord')">
|
||||
<view>{{ $lang("tool.order.refund_detail.l19.t0") }}</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
|
||||
<view class="refund-address-wrap" v-if="detail.refund_status == 4">
|
||||
<view class="header">{{ $lang("tool.order.refund_detail.l24.t0") }}</view>
|
||||
<view>
|
||||
<text>{ $lang("tool.order.refund_detail.l26.t0") } detail.shop_contacts }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text>{ $lang("tool.order.refund_detail.l29.t0") } detail.shop_mobile }}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text class="address">{ $lang("tool.order.refund_detail.l32.t0") } detail.shop_address }}</text>
|
||||
<view class="copy" @click="$util.copy(detail.shop_address)">{{ $lang("order.detail.l109") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="refund-info">
|
||||
<view class="header">{{ $lang("tool.order.refund_detail.l38.t0") }}</view>
|
||||
<view class="body">
|
||||
<!-- 商品信息 -->
|
||||
<view class="goods-wrap">
|
||||
<view class="goods-img" @click="refundDetail(detail)">
|
||||
<image :src="$util.img(detail.sku_image, { size: 'mid' })" @error="imageError()" mode="aspectFill" :lazy-load="true" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="goods-info">
|
||||
<view class="goods-name" @click="refundDetail(detail)">{{ detail.sku_name }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 退款信息 -->
|
||||
<view class="info">
|
||||
<view class="cell">{ $lang("tool.order.refund_batch.l26.t0") } detail.refund_type == 1 ? '仅退款' : $lang('tool.order.refund_detail.l51.t1') }}</view>
|
||||
<view class="cell" v-if="detail.refund_status == 3">{ $lang("tool.order.refund_detail.l52.t3") } detail.refund_money_type == 1 ? '原路退款' : detail.refund_money_type == 2 ? '线下退款' : $lang('tool.order.refund_detail.l52.t2') }}</view>
|
||||
<view class="cell">{ $lang("tool.order.refund.l34.t0") } detail.refund_reason }}</view>
|
||||
<view class="cell" v-if="detail.refund_status == 3 && detail.refund_real_money>0">{ $lang("tool.order.refund.l42.t0") } $lang('common.currency_symbol') }}{{ detail.refund_real_money }}</view>
|
||||
<view class="cell" v-else-if="detail.refund_apply_money>0">{ $lang("tool.order.refund.l42.t0") } $lang('common.currency_symbol') }}{{ detail.refund_apply_money }}</view>
|
||||
<view class="cell">{ $lang("tool.order.refund_detail.l56.t0") } detail.refund_no }}</view>
|
||||
<view class="cell">{ $lang("tool.order.refund_detail.l57.t0") } $util.timeStampTurnTime(detail.refund_action_time) }}</view>
|
||||
<view class="cell" v-if="detail.refund_time">{ $lang("tool.order.refund_detail.l58.t0") } $util.timeStampTurnTime(detail.refund_time) }}</view>
|
||||
<view class="cell" v-if="detail.refund_remark != ''">{ $lang("tool.order.refund_detail.l59.t0") } detail.refund_remark }}</view>
|
||||
<view class="cell" v-if="detail.use_point>0">{ $lang("tool.order.refund_detail.l60.t0") } detail.use_point }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="action" :class="{ 'bottom-safe-area': isIphoneX }" v-if="detail.refund_action.length">
|
||||
<view class="order-box-btn" v-for="(actionItem, actionIndex) in detail.refund_action" :key="actionIndex" @click="refundAction(actionItem.event)">
|
||||
{{ actionItem.title }}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-show="action == 'returngoods'">
|
||||
<view class="return-goods-container">
|
||||
<view class="form-wrap">
|
||||
<view class="item">
|
||||
<view class="label">{{ $lang("tool.order.refund_detail.l76.t0") }}</view>
|
||||
<view class="cont">
|
||||
<input
|
||||
type="text"
|
||||
placeholder=$lang("tool.order.refund_detail.l80.t0")
|
||||
class="input"
|
||||
placeholder-class="input-placeholder color-tip"
|
||||
v-model="formData.refund_delivery_name"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label">{{ $lang("tool.order.refund_detail.l88.t0") }}</view>
|
||||
<view class="cont">
|
||||
<input
|
||||
type="text"
|
||||
placeholder=$lang("tool.order.refund_detail.l92.t0")
|
||||
class="input"
|
||||
placeholder-class="input-placeholder color-tip"
|
||||
v-model="formData.refund_delivery_no"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item">
|
||||
<view class="label">{{ $lang("tool.order.refund_detail.l100.t0") }}</view>
|
||||
<view class="cont">
|
||||
<textarea
|
||||
placeholder-class="color-tip font-size-tag"
|
||||
:auto-height="true"
|
||||
class="textarea"
|
||||
placeholder=$lang("tool.order.refund_detail.l106.t0")
|
||||
v-model="formData.refund_delivery_remark"
|
||||
/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<button type="primary" class="sub-btn" @click="refurnGoods">{{ $lang("diy.diy-form.l142.t0") }}</button>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view v-show="action == 'consultrecord'">
|
||||
<view class="record-wrap">
|
||||
<view class="record-item" :class="logItem.action_way == 1 ? 'buyer' : ''" v-for="(logItem, logIndex) in detail.refund_log_list" :key="logIndex">
|
||||
<view class="cont">
|
||||
<view class="head">
|
||||
<text>{{ logItem.action_way == 1 ? '买家' : $lang('tool.order.refund_detail.l121.t1') }}</text>
|
||||
<text class="time">{{ $util.timeStampTurnTime(logItem.action_time) }}</text>
|
||||
</view>
|
||||
<view class="body">
|
||||
<view class="refund-action">{{ logItem.action }}</view>
|
||||
<view class="desc" v-if="logItem.desc != ''">{{ logItem.desc }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="empty-box"></view>
|
||||
</view>
|
||||
<view class="history-bottom" :class="{ 'bottom-safe-area': isIphoneX }">
|
||||
<!-- <ns-contact :niushop="{order_id: detail.order_id}">
|
||||
<view>
|
||||
<text class="iconfont icon-ziyuan"></text>
|
||||
<text>{{ $lang("common.ns-contact.l32.t0") }}</text>
|
||||
</view>
|
||||
</ns-contact> -->
|
||||
<view @click="switchAction('')">{{ $lang("tool.order.refund_detail.l139.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import refundMethod from './public/js/refundMethod.js';
|
||||
import validate from 'common/js/validate.js';
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
order_goods_id: '',
|
||||
detail: {
|
||||
refund_action: []
|
||||
},
|
||||
isIphoneX: false,
|
||||
action: '',
|
||||
formData: {
|
||||
refund_delivery_name: '',
|
||||
refund_delivery_no: '',
|
||||
refund_delivery_remark: ''
|
||||
},
|
||||
isSub: false
|
||||
};
|
||||
},
|
||||
mixins: [refundMethod],
|
||||
onLoad(option) {
|
||||
if (option.order_goods_id) this.order_goods_id = option.order_goods_id;
|
||||
if (option.action) this.action = option.action;
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
onShow() {
|
||||
if (this.storeToken) {
|
||||
this.getRefundDetail();
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, { back: '/pages_tool/order/refund_detail?order_goods_id=' + this.order_goods_id });
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getRefundDetail() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/detail',
|
||||
data: {
|
||||
order_goods_id: this.order_goods_id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.detail = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({ title: $lang('tool.order.refund.l175.t0') });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
refundAction(event) {
|
||||
switch (event) {
|
||||
case 'orderRefundCancel':
|
||||
this.cancleRefund(this.detail.order_goods_id, res => {
|
||||
if (res.code >= 0) {
|
||||
this.$util.showToast({ title: $lang('tool.order.activist.l115.t0') });
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
break;
|
||||
case 'orderRefundDelivery':
|
||||
this.action = 'returngoods';
|
||||
break;
|
||||
case 'orderRefundAsk':
|
||||
this.$util.redirectTo('/pages_tool/order/refund', { order_goods_id: this.detail.order_goods_id });
|
||||
break;
|
||||
}
|
||||
},
|
||||
refurnGoods() {
|
||||
var rule = [
|
||||
{ name: 'refund_delivery_name', checkType: 'required', errorMsg: $lang('tool.order.refund_detail.l80.t0') },
|
||||
{ name: 'refund_delivery_no', checkType: 'required', errorMsg: $lang('tool.order.refund_detail.l92.t0') }
|
||||
];
|
||||
this.formData.order_goods_id = this.order_goods_id;
|
||||
var checkRes = validate.check(this.formData, rule);
|
||||
if (checkRes) {
|
||||
if (this.isSub) return;
|
||||
this.isSub = true;
|
||||
this.$api.sendRequest({
|
||||
url: '/api/orderrefund/delivery',
|
||||
data: this.formData,
|
||||
success: res => {
|
||||
if (res.code == 0) {
|
||||
this.action = '';
|
||||
this.getRefundDetail();
|
||||
} else {
|
||||
this.$util.showToast({ title: res.message });
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({ title: validate.error });
|
||||
return false;
|
||||
}
|
||||
},
|
||||
/**
|
||||
* 切换操作
|
||||
*/
|
||||
switchAction(action) {
|
||||
this.action = action;
|
||||
},
|
||||
imageError() {
|
||||
this.detail.sku_image = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
refundDetail(e) {
|
||||
this.$util.redirectTo('/pages_goods/detail', {
|
||||
goods_id: e.goods_id
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/refund_detail.scss';
|
||||
</style>
|
||||
|
||||
@@ -1,225 +1,225 @@
|
||||
<template>
|
||||
<view class="goods-select" :style="themeColor">
|
||||
<view class="top">
|
||||
共<text class="color-base-text">{{refund_data.length}}</text>件商品
|
||||
</view>
|
||||
|
||||
<view class="body">
|
||||
<view class="item" v-for="(item,index) in refund_data" :key="index">
|
||||
<view @click="single(index)" style="display:none">
|
||||
<text v-if="item.judge" class="iconfont icon-yuan_checked color-base-text"></text>
|
||||
<text v-else class="iconfont icon-yuan_checkbox"></text>
|
||||
</view>
|
||||
<image :src="$util.img(item.sku_image)" @error="error(index)" show-menu-by-longpress></image>
|
||||
<view class="title">
|
||||
<text>{{item.sku_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bottom-all">
|
||||
<view >
|
||||
<!-- @click="all"
|
||||
<text v-if="judge" class="iconfont icon-yuan_checked color-base-text"></text>
|
||||
<text v-else class="iconfont icon-yuan_checkbox"></text> -->
|
||||
</view>
|
||||
|
||||
<view v-if="nexthover" class="next" @click="next">下一步</view>
|
||||
<view v-else class="next nexthover">请选择商品</view>
|
||||
</view>
|
||||
|
||||
<!-- <loading-cover ref="loadingCover"></loading-cover> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
refund_type:1,
|
||||
refund_data:[],
|
||||
judge:true,
|
||||
order_goods_id:[],
|
||||
nexthover:true
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(option){
|
||||
if(option.refund_type){
|
||||
this.refund_type = option.refund_type;
|
||||
this.getGoodsInfo()
|
||||
} else{
|
||||
uni.showToast({
|
||||
title:'未查找到订单信息',
|
||||
icon:'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
},1000)
|
||||
}
|
||||
},
|
||||
|
||||
methods:{
|
||||
/**
|
||||
* 处理商品选中数据
|
||||
*/
|
||||
getGoodsInfo(){
|
||||
uni.getStorage({
|
||||
key:'refund_goods_data',
|
||||
success:res=>{
|
||||
let refund_data = JSON.parse(res.data);
|
||||
this.refund_data = [];
|
||||
refund_data.forEach(item=>{
|
||||
if(item.refund_status == 0){
|
||||
item.judge = true;
|
||||
this.refund_data.push(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
*单选事件
|
||||
*/
|
||||
single(key){
|
||||
this.refund_data[key].judge = !this.refund_data[key].judge;
|
||||
let allJudge = true;
|
||||
|
||||
this.refund_data.forEach((item)=>{
|
||||
if(!item.judge){
|
||||
allJudge = false;
|
||||
}
|
||||
})
|
||||
this.judge = allJudge;
|
||||
|
||||
this.getOrderIdInfo();
|
||||
this.$forceUpdate()
|
||||
},
|
||||
/**
|
||||
* 全选选择
|
||||
*/
|
||||
all(){
|
||||
|
||||
this.judge = !this.judge;
|
||||
this.refund_data.map(item=>{
|
||||
item.judge = this.judge;
|
||||
return item;
|
||||
})
|
||||
|
||||
this.getOrderIdInfo();
|
||||
this.$forceUpdate()
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取选择的order_goods_id
|
||||
*/
|
||||
getOrderIdInfo(){
|
||||
this.order_goods_id = [];
|
||||
this.refund_data.forEach(item=>{
|
||||
if(item.judge){
|
||||
this.order_goods_id.push(item.order_goods_id)
|
||||
}
|
||||
})
|
||||
if(this.order_goods_id.length == 0){
|
||||
this.nexthover = false;
|
||||
}else{
|
||||
this.nexthover = true;
|
||||
}
|
||||
|
||||
this.$forceUpdate();
|
||||
},
|
||||
/**
|
||||
* 跳转退款界面
|
||||
*/
|
||||
next(){
|
||||
this.refund_data.forEach(item=>{
|
||||
this.order_goods_id.push(item.order_goods_id)
|
||||
})
|
||||
if(this.order_goods_id.length == 0){
|
||||
this.getOrderIdInfo();
|
||||
}
|
||||
|
||||
this.$util.redirectTo('/pages_tool/order/refund_batch', { order_goods_id: this.order_goods_id.join(), refund_type:this.refund_type });
|
||||
},
|
||||
/**
|
||||
* 默认图片处理
|
||||
*/
|
||||
error(index){
|
||||
this.refund_data[index].sku_image = this.$util.getDefaultImage().goods
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.goods-select{
|
||||
.top{
|
||||
padding: 20rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
background: #FFFFFF;
|
||||
text{
|
||||
font-size: 30rpx;
|
||||
margin: 0 10rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.iconfont{
|
||||
font-size: 40rpx;
|
||||
}
|
||||
.body{
|
||||
margin: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
background: #FFFFFF;
|
||||
padding: 30rpx 0 0;
|
||||
.item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 30rpx 30rpx;
|
||||
|
||||
image{
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.title{
|
||||
width: 368rpx;
|
||||
height:180rpx;
|
||||
font-size: 28rpx;
|
||||
text{
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.bottom-all{
|
||||
padding-left: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #FFFFFF;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
.next{
|
||||
padding: 16rpx 80rpx;
|
||||
color: #FFFFFF;
|
||||
background: #ff4544;
|
||||
}
|
||||
.nexthover{
|
||||
background: #e7dcdc !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
<template>
|
||||
<view class="goods-select" :style="themeColor">
|
||||
<view class="top">
|
||||
共<text class="color-base-text">{{refund_data.length}}</text>件商品
|
||||
</view>
|
||||
|
||||
<view class="body">
|
||||
<view class="item" v-for="(item,index) in refund_data" :key="index">
|
||||
<view @click="single(index)" style="display:none">
|
||||
<text v-if="item.judge" class="iconfont icon-yuan_checked color-base-text"></text>
|
||||
<text v-else class="iconfont icon-yuan_checkbox"></text>
|
||||
</view>
|
||||
<image :src="$util.img(item.sku_image)" @error="error(index)" show-menu-by-longpress></image>
|
||||
<view class="title">
|
||||
<text>{{item.sku_name}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="bottom-all">
|
||||
<view >
|
||||
<!-- @click="all"
|
||||
<text v-if="judge" class="iconfont icon-yuan_checked color-base-text"></text>
|
||||
<text v-else class="iconfont icon-yuan_checkbox"></text> -->
|
||||
</view>
|
||||
|
||||
<view v-if="nexthover" class="next" @click="next">{{ $lang("member.cancellation.l15") }}</view>
|
||||
<view v-else class="next nexthover">{{ $lang("tool.order.refund_goods_select.l28.t0") }}</view>
|
||||
</view>
|
||||
|
||||
<!-- <loading-cover ref="loadingCover"></loading-cover> -->
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
data(){
|
||||
return{
|
||||
refund_type:1,
|
||||
refund_data:[],
|
||||
judge:true,
|
||||
order_goods_id:[],
|
||||
nexthover:true
|
||||
}
|
||||
},
|
||||
|
||||
onLoad(option){
|
||||
if(option.refund_type){
|
||||
this.refund_type = option.refund_type;
|
||||
this.getGoodsInfo()
|
||||
} else{
|
||||
uni.showToast({
|
||||
title:$lang('tool.order.refund_goods_select.l53.t0'),
|
||||
icon:'none'
|
||||
})
|
||||
setTimeout(()=>{
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
},1000)
|
||||
}
|
||||
},
|
||||
|
||||
methods:{
|
||||
/**
|
||||
* 处理商品选中数据
|
||||
*/
|
||||
getGoodsInfo(){
|
||||
uni.getStorage({
|
||||
key:'refund_goods_data',
|
||||
success:res=>{
|
||||
let refund_data = JSON.parse(res.data);
|
||||
this.refund_data = [];
|
||||
refund_data.forEach(item=>{
|
||||
if(item.refund_status == 0){
|
||||
item.judge = true;
|
||||
this.refund_data.push(item);
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
/**
|
||||
*单选事件
|
||||
*/
|
||||
single(key){
|
||||
this.refund_data[key].judge = !this.refund_data[key].judge;
|
||||
let allJudge = true;
|
||||
|
||||
this.refund_data.forEach((item)=>{
|
||||
if(!item.judge){
|
||||
allJudge = false;
|
||||
}
|
||||
})
|
||||
this.judge = allJudge;
|
||||
|
||||
this.getOrderIdInfo();
|
||||
this.$forceUpdate()
|
||||
},
|
||||
/**
|
||||
* 全选选择
|
||||
*/
|
||||
all(){
|
||||
|
||||
this.judge = !this.judge;
|
||||
this.refund_data.map(item=>{
|
||||
item.judge = this.judge;
|
||||
return item;
|
||||
})
|
||||
|
||||
this.getOrderIdInfo();
|
||||
this.$forceUpdate()
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取选择的order_goods_id
|
||||
*/
|
||||
getOrderIdInfo(){
|
||||
this.order_goods_id = [];
|
||||
this.refund_data.forEach(item=>{
|
||||
if(item.judge){
|
||||
this.order_goods_id.push(item.order_goods_id)
|
||||
}
|
||||
})
|
||||
if(this.order_goods_id.length == 0){
|
||||
this.nexthover = false;
|
||||
}else{
|
||||
this.nexthover = true;
|
||||
}
|
||||
|
||||
this.$forceUpdate();
|
||||
},
|
||||
/**
|
||||
* 跳转退款界面
|
||||
*/
|
||||
next(){
|
||||
this.refund_data.forEach(item=>{
|
||||
this.order_goods_id.push(item.order_goods_id)
|
||||
})
|
||||
if(this.order_goods_id.length == 0){
|
||||
this.getOrderIdInfo();
|
||||
}
|
||||
|
||||
this.$util.redirectTo('/pages_tool/order/refund_batch', { order_goods_id: this.order_goods_id.join(), refund_type:this.refund_type });
|
||||
},
|
||||
/**
|
||||
* 默认图片处理
|
||||
*/
|
||||
error(index){
|
||||
this.refund_data[index].sku_image = this.$util.getDefaultImage().goods
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.goods-select{
|
||||
.top{
|
||||
padding: 20rpx 30rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 28rpx;
|
||||
background: #FFFFFF;
|
||||
text{
|
||||
font-size: 30rpx;
|
||||
margin: 0 10rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
.iconfont{
|
||||
font-size: 40rpx;
|
||||
}
|
||||
.body{
|
||||
margin: 30rpx;
|
||||
border-radius: 10rpx;
|
||||
background: #FFFFFF;
|
||||
padding: 30rpx 0 0;
|
||||
.item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 0 30rpx 30rpx;
|
||||
|
||||
image{
|
||||
width: 180rpx;
|
||||
height: 180rpx;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
.title{
|
||||
width: 368rpx;
|
||||
height:180rpx;
|
||||
font-size: 28rpx;
|
||||
text{
|
||||
text-overflow: -o-ellipsis-lastline;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.bottom-all{
|
||||
padding-left: 30rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
background: #FFFFFF;
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
.next{
|
||||
padding: 16rpx 80rpx;
|
||||
color: #FFFFFF;
|
||||
background: #ff4544;
|
||||
}
|
||||
.nexthover{
|
||||
background: #e7dcdc !important;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,116 +1,116 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<view class="refund-option">
|
||||
<view class="option-item" @click="selectRefundType(1)">
|
||||
<view>
|
||||
<text>退款无需退货</text>
|
||||
<text class="font-size-goods-tag color-tip">没收到货,或与卖家协商同意无需退货只退款</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<view class="option-item" @click="selectRefundType(2)" v-if="refund_data.order_status == 3">
|
||||
<view>
|
||||
<text>退货退款</text>
|
||||
<text class="font-size-goods-tag color-tip">已收到货,需退还收到的货物</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
order_id: '',
|
||||
isIphoneX: false,
|
||||
refund_data: {},
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_id) this.order_id = option.order_id;
|
||||
},
|
||||
onShow() {
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (this.storeToken) {
|
||||
this.getRefundData();
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||
back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 选择退款方式
|
||||
* @param {Object} type
|
||||
*/
|
||||
selectRefundType(type) {
|
||||
this.$util.redirectTo('/pages_tool/order/refund_goods_select', {
|
||||
refund_type: type
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取退款订单数据
|
||||
*/
|
||||
getRefundData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/order/detail',
|
||||
data: {
|
||||
order_id: this.order_id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.refund_data = res.data;
|
||||
uni.setStorage({
|
||||
key: 'refund_goods_data',
|
||||
data: JSON.stringify(res.data.order_goods),
|
||||
})
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '未获取到该订单项退款信息'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/refund.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
|
||||
::v-deep .uni-popup {
|
||||
z-index: 8;
|
||||
}
|
||||
|
||||
.sub-btn {
|
||||
padding-top: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<view>
|
||||
<view class="refund-option">
|
||||
<view class="option-item" @click="selectRefundType(1)">
|
||||
<view>
|
||||
<text>{{ $lang("tool.order.refund.l17.t0") }}</text>
|
||||
<text class="font-size-goods-tag color-tip">{{ $lang("tool.order.refund.l18.t0") }}</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
<view class="option-item" @click="selectRefundType(2)" v-if="refund_data.order_status == 3">
|
||||
<view>
|
||||
<text>{{ $lang("tool.order.refund.l24.t0") }}</text>
|
||||
<text class="font-size-goods-tag color-tip">{{ $lang("tool.order.refund.l25.t0") }}</text>
|
||||
</view>
|
||||
<text class="iconfont icon-right"></text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
order_id: '',
|
||||
isIphoneX: false,
|
||||
refund_data: {},
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.order_id) this.order_id = option.order_id;
|
||||
},
|
||||
onShow() {
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
if (this.storeToken) {
|
||||
this.getRefundData();
|
||||
} else {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL, {
|
||||
back: '/pages_tool/order/refund?order_goods_id=' + this.order_goods_id
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/**
|
||||
* 选择退款方式
|
||||
* @param {Object} type
|
||||
*/
|
||||
selectRefundType(type) {
|
||||
this.$util.redirectTo('/pages_tool/order/refund_goods_select', {
|
||||
refund_type: type
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 获取退款订单数据
|
||||
*/
|
||||
getRefundData() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/order/detail',
|
||||
data: {
|
||||
order_id: this.order_id
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0) {
|
||||
this.refund_data = res.data;
|
||||
uni.setStorage({
|
||||
key: 'refund_goods_data',
|
||||
data: JSON.stringify(res.data.order_goods),
|
||||
})
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('tool.order.refund.l175.t0')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_order/list');
|
||||
}, 1000);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import './public/css/refund.scss';
|
||||
</style>
|
||||
<style scoped>
|
||||
::v-deep .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
background: none;
|
||||
max-height: unset !important;
|
||||
overflow-y: hidden !important;
|
||||
}
|
||||
|
||||
::v-deep .uni-popup__wrapper {
|
||||
border-radius: 20rpx 20rpx 0 0;
|
||||
}
|
||||
|
||||
::v-deep .uni-popup {
|
||||
z-index: 8;
|
||||
}
|
||||
|
||||
.sub-btn {
|
||||
padding-top: 20rpx;
|
||||
background-color: #FFFFFF;
|
||||
}
|
||||
</style>
|
||||
@@ -18,9 +18,9 @@
|
||||
<text class="iconfont" :class="payIndex == index ? 'icon-yuan_checked color-base-text' : 'icon-checkboxblank'"></text>
|
||||
</view>
|
||||
</view>
|
||||
<button type="primary" @click="confirm">确认支付</button>
|
||||
<button type="primary" @click="confirm">{{ $lang("common.ns-payment.l39.t0") }}</button>
|
||||
</block>
|
||||
<view v-else class="empty">店铺尚未配置支付方式!</view>
|
||||
<view v-else class="empty">{{ $lang("tool.pay.cashier.l23.t0") }}</view>
|
||||
</block>
|
||||
<ns-empty text="该支付单据已支付" :is-index="true" v-else></ns-empty>
|
||||
</block>
|
||||
@@ -40,12 +40,12 @@ export default {
|
||||
// #ifdef H5
|
||||
payTypeList: [
|
||||
{
|
||||
name: '支付宝支付',
|
||||
name: $lang('common.ns-payment.l75.t0'),
|
||||
icon: 'icon-zhifubaozhifu-',
|
||||
type: 'alipay'
|
||||
},
|
||||
{
|
||||
name: '微信支付',
|
||||
name: $lang('common.ns-payment.l80.t0'),
|
||||
icon: 'icon-weixin1',
|
||||
type: 'wechatpay'
|
||||
}
|
||||
@@ -54,7 +54,7 @@ export default {
|
||||
// #endif
|
||||
// #ifdef MP-WEIXIN
|
||||
payTypeList: [{
|
||||
name: '微信支付',
|
||||
name: $lang('common.ns-payment.l80.t0'),
|
||||
provider: 'wxpay',
|
||||
icon: 'icon-weixin1',
|
||||
type: 'wechatpay'
|
||||
@@ -131,12 +131,12 @@ export default {
|
||||
}
|
||||
if (this.payTypeList.length == 0 && this.payInfo.pay_money > 0) {
|
||||
this.$util.showToast({
|
||||
title: '请选择支付方式!'
|
||||
title: $lang('common.ns-payment.l161.t0')
|
||||
});
|
||||
return;
|
||||
}
|
||||
uni.showLoading({
|
||||
title: '支付中...',
|
||||
title: $lang('common.ns-payment.l166.t0'),
|
||||
mask: true
|
||||
});
|
||||
this.pay();
|
||||
@@ -265,7 +265,7 @@ export default {
|
||||
fail: res => {
|
||||
this.flag = false;
|
||||
if (res.errMsg == 'requestPayment:fail cancel') {
|
||||
this.$util.showToast({ title: '您已取消支付' });
|
||||
this.$util.showToast({ title: $lang('common.ns-payment.l298.t0') });
|
||||
} else {
|
||||
uni.showModal({ content: '支付失败,失败原因: ' + res.errMsg, showCancel: false });
|
||||
}
|
||||
|
||||
@@ -1,143 +1,143 @@
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="true" class="pay-container">
|
||||
<view class="payment-amount">
|
||||
<text class="amount-tit">{{ $lang('paymentAmount') }}</text>
|
||||
<view class="amount-num">
|
||||
{{ $lang('common.currencySymbol') }}
|
||||
<text>{{ payInfo.pay_money }}</text>
|
||||
</view>
|
||||
<view class="payment-name">{{ payInfo.pay_body }}</view>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
isIphoneX: false,
|
||||
payInfo: {},
|
||||
outTradeNo: '',
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.code) this.outTradeNo = option.code;
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
onShow() {
|
||||
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getPayInfo();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getPayInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payInfo = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '未获取到支付信息!'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.pay-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
@mixin flex-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@mixin flex-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.payment-amount {
|
||||
@include flex-column;
|
||||
margin: $margin-updown $margin-both;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 0 58rpx 0;
|
||||
background-color: #fff;
|
||||
|
||||
.amount-tit {
|
||||
font-size: $font-size-base;
|
||||
color: #838383;
|
||||
line-height: 1;
|
||||
margin-top: 44rpx;
|
||||
}
|
||||
|
||||
.amount-num {
|
||||
color: #000;
|
||||
margin-top: 36rpx;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.amount-desc {
|
||||
font-size: $font-size-tag;
|
||||
color: #838383;
|
||||
padding: 0 40rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
width: 100%;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.payment-name {
|
||||
width: 90%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: #838383;
|
||||
margin-top: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view :style="themeColor">
|
||||
<scroll-view scroll-y="true" class="pay-container">
|
||||
<view class="payment-amount">
|
||||
<text class="amount-tit">{{ $lang('order.list.payment_amount') }}</text>
|
||||
<view class="amount-num">
|
||||
{{ $lang('common.currency_symbol') }}
|
||||
<text>{{ payInfo.pay_money }}</text>
|
||||
</view>
|
||||
<view class="payment-name">{{ payInfo.pay_body }}</view>
|
||||
</view>
|
||||
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
|
||||
</scroll-view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
isIphoneX: false,
|
||||
payInfo: {},
|
||||
outTradeNo: '',
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.code) this.outTradeNo = option.code;
|
||||
this.isIphoneX = this.$util.uniappIsIPhoneX();
|
||||
},
|
||||
onShow() {
|
||||
|
||||
if (!this.storeToken) {
|
||||
this.$util.redirectTo(this.$util.LOGIN_PAGE_URL);
|
||||
} else {
|
||||
this.getPayInfo();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getPayInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payInfo = res.data;
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('common.ns-payment.l185.t0')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL);
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.pay-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
@mixin flex-column {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
@mixin flex-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.payment-amount {
|
||||
@include flex-column;
|
||||
margin: $margin-updown $margin-both;
|
||||
border-radius: 8rpx;
|
||||
padding: 20rpx 0 58rpx 0;
|
||||
background-color: #fff;
|
||||
|
||||
.amount-tit {
|
||||
font-size: $font-size-base;
|
||||
color: #838383;
|
||||
line-height: 1;
|
||||
margin-top: 44rpx;
|
||||
}
|
||||
|
||||
.amount-num {
|
||||
color: #000;
|
||||
margin-top: 36rpx;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
|
||||
.amount-desc {
|
||||
font-size: $font-size-tag;
|
||||
color: #838383;
|
||||
padding: 0 40rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
|
||||
text {
|
||||
width: 100%;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
}
|
||||
|
||||
.payment-name {
|
||||
width: 90%;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: #838383;
|
||||
margin-top: 30rpx;
|
||||
text-align: center;
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,345 +1,345 @@
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<template v-if="payInfo.pay_status != undefined">
|
||||
<view class="result-box">
|
||||
<template v-if="payInfo.pay_status">
|
||||
<image :src="$util.img('public/uniapp/pay/pay_success.png')" mode="widthFix" lazy-load="true" class="result-image" show-menu-by-longpress/>
|
||||
<view class="msg success">{{ $lang('paymentSuccess') }}</view>
|
||||
<view class="pay-amount">
|
||||
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
|
||||
<text class="price-style large">{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[0] }}</text>
|
||||
<text class="price-style small">.{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[1] }}</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<image :src="$util.img('public/uniapp/pay/pay_fail.png')" mode="widthFix" class="result-image" show-menu-by-longpress/>
|
||||
<view class="msg fail">{{ $lang('paymentFail') }}</view>
|
||||
</template>
|
||||
|
||||
<view class="consume-box" v-if="addonIsExist.memberconsume && consumeStatus == 1 && payInfo.pay_status">
|
||||
<view class="consume-head">
|
||||
<view class="consume-head-text">恭喜您获得</view>
|
||||
</view>
|
||||
<view class="consume-list">
|
||||
<view class="consume-item" v-if="consumeInfo.point_num > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/point.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.point_num }}</view>
|
||||
<view class="consume-type">积分</view>
|
||||
</view>
|
||||
<view class="consume-item" v-if="consumeInfo.growth_num > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/growth.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.growth_num }}</view>
|
||||
<view class="consume-type">成长值</view>
|
||||
</view>
|
||||
<view class="consume-item" v-if="consumeInfo.coupon_list.length > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/coupon.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.coupon_list.length }}</view>
|
||||
<view class="consume-type">张优惠券</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="action">
|
||||
<template v-if="storeToken">
|
||||
<view v-if="paySource == 'recharge'" class="btn" @click="toRecharge()">充值记录</view>
|
||||
<view v-else-if="paySource == 'membercard'" class="btn" @click="toCard()">会员卡</view>
|
||||
<view v-else-if="paySource == 'presale'" class="btn" @click="toPresaleOrder()">查看订单</view>
|
||||
<view v-else-if="paySource == 'giftcard'" class="btn" @click="toOrder()">查看订单</view>
|
||||
<view v-else-if="paySource == 'pointexchange'" class="btn" @click="toExchangeOrder()">查看订单
|
||||
</view>
|
||||
<view v-else class="btn" @click="toOrderDetail(payInfo.order_id)">查看订单</view>
|
||||
</template>
|
||||
<view class="btn go-home" @click="goHome()">{{ $lang('goHome') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<ns-goods-recommend route="pay"></ns-goods-recommend>
|
||||
</template>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
payInfo: {},
|
||||
outTradeNo: '',
|
||||
paySource: '',
|
||||
consumeInfo: {},
|
||||
consumeStatus: 0,
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.code) this.outTradeNo = option.code;
|
||||
this.paySource = uni.getStorageSync('paySource');
|
||||
},
|
||||
onShow() {
|
||||
this.getPayInfo();
|
||||
this.getConsume();
|
||||
},
|
||||
methods: {
|
||||
consume(type) {
|
||||
switch (type) {
|
||||
case 'point':
|
||||
this.$util.redirectTo('/pages_tool/member/point_detail', {});
|
||||
break;
|
||||
case 'growth':
|
||||
this.$util.redirectTo('/pages_tool/member/level', {});
|
||||
break;
|
||||
case 'coupon':
|
||||
this.$util.redirectTo('/pages_tool/member/coupon', {});
|
||||
break;
|
||||
default:
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||
break;
|
||||
}
|
||||
},
|
||||
getConsume() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberconsume/api/config/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
let reward = res.data.value;
|
||||
if (res.data.is_use && (reward.point_num > 0 || reward.growth_num > 0 || reward.coupon_list.length)) {
|
||||
this.consumeStatus = res.data.is_use;
|
||||
this.consumeInfo = res.data.value;
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
getPayInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payInfo = res.data;
|
||||
this.payInfo.pay_money = parseFloat(res.data.pay_money);
|
||||
this.payInfo.pay_money += parseFloat(res.data.balance);
|
||||
this.payInfo.pay_money += parseFloat(res.data.balance_money);
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '未获取到支付信息!'
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
goHome() {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
||||
},
|
||||
toOrderDetail(id) {
|
||||
if (this.payInfo.order_type == 2) {
|
||||
this.$util.redirectTo('/pages_order/detail_pickup', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else if (this.payInfo.order_type == 3) {
|
||||
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else if (this.payInfo.order_type == 4) {
|
||||
this.$util.redirectTo('/pages_tool/order/detail_virtual', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
}
|
||||
},
|
||||
toOrder(id) {
|
||||
this.$util.redirectTo('/pages_promotion/giftcard/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toRecharge() {
|
||||
this.$util.redirectTo('/pages_tool/recharge/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toCard() {
|
||||
this.$util.redirectTo('/pages_tool/member/card', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toPresaleOrder() {
|
||||
this.$util.redirectTo('/pages_promotion/presale/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toExchangeOrder() {
|
||||
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.consume-box {
|
||||
padding: $padding;
|
||||
background: #F8F8F8;
|
||||
width: calc(100% - 48rpx);
|
||||
margin: 0 24rpx 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.consume-head {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
|
||||
.consume-head-text {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.consume-list {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.consume-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: $color-title;
|
||||
font-size: $font-size-base;
|
||||
margin-top: 10rpx;
|
||||
|
||||
image {
|
||||
width: 24rpx;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.consume-value {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.consume-remark {
|
||||
color: $color-tip;
|
||||
font-size: $font-size-tag;
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.result-box {
|
||||
padding-top: 94rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background-color: #FFFFFF;
|
||||
width: 100%;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.result-image {
|
||||
width: 80rpx;
|
||||
height: auto;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.msg {
|
||||
font-size: 32rpx;
|
||||
margin-top: 25rpx;
|
||||
|
||||
&.success {
|
||||
color: #09BB07;
|
||||
}
|
||||
|
||||
&.fail {
|
||||
// P0: 失败提示色 → var(--base-color)
|
||||
// 兼容: 微信小程序 / 鸿蒙元服务 — color 接受 var() 无问题
|
||||
color: var(--base-color, #FF4646);
|
||||
}
|
||||
}
|
||||
|
||||
.pay-amount {
|
||||
font-size: 30rpx;
|
||||
margin: 40rpx 0 24rpx 0;
|
||||
font-weight: 600;
|
||||
line-height: 50rpx;
|
||||
|
||||
text {
|
||||
color: #333333 !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.unit {
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.large {
|
||||
font-size: 60rpx !important;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 36rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
margin-top: 24rpx;
|
||||
|
||||
.btn {
|
||||
font-size: 30rpx;
|
||||
width: 200rpx;
|
||||
height: 66rpx;
|
||||
line-height: 66rpx;
|
||||
text-align: center;
|
||||
border-radius: 66rpx;
|
||||
border: 1px solid $color-tip;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-child {
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.go-home {
|
||||
background-color: $base-color;
|
||||
color: #fff;
|
||||
border-color: $base-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .goods-recommend {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
<template>
|
||||
<view class="container" :style="themeColor">
|
||||
<template v-if="payInfo.pay_status != undefined">
|
||||
<view class="result-box">
|
||||
<template v-if="payInfo.pay_status">
|
||||
<image :src="$util.img('public/uniapp/pay/pay_success.png')" mode="widthFix" lazy-load="true" class="result-image" show-menu-by-longpress/>
|
||||
<view class="msg success">{{ $lang('order.list.payment_success') }}</view>
|
||||
<view class="pay-amount">
|
||||
<text class="unit price-style small">{{ $lang('common.currency_symbol') }}</text>
|
||||
<text class="price-style large">{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[0] }}</text>
|
||||
<text class="price-style small">.{{ parseFloat(payInfo.pay_money).toFixed(2).split(".")[1] }}</text>
|
||||
</view>
|
||||
</template>
|
||||
<template v-else>
|
||||
<image :src="$util.img('public/uniapp/pay/pay_fail.png')" mode="widthFix" class="result-image" show-menu-by-longpress/>
|
||||
<view class="msg fail">{{ $lang('order.list.payment_fail') }}</view>
|
||||
</template>
|
||||
|
||||
<view class="consume-box" v-if="addonIsExist.memberconsume && consumeStatus == 1 && payInfo.pay_status">
|
||||
<view class="consume-head">
|
||||
<view class="consume-head-text">{{ $lang("tool.pay.result.l21.t0") }}</view>
|
||||
</view>
|
||||
<view class="consume-list">
|
||||
<view class="consume-item" v-if="consumeInfo.point_num > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/point.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.point_num }}</view>
|
||||
<view class="consume-type">{{ $lang("common.register-reward.l19.t0") }}</view>
|
||||
</view>
|
||||
<view class="consume-item" v-if="consumeInfo.growth_num > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/growth.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.growth_num }}</view>
|
||||
<view class="consume-type">{{ $lang("common.register-reward.l27.t0") }}</view>
|
||||
</view>
|
||||
<view class="consume-item" v-if="consumeInfo.coupon_list.length > 0">
|
||||
<image :src="$util.img('public/uniapp/pay/coupon.png')" mode="widthFix" show-menu-by-longpress></image>
|
||||
<view class="consume-value color-base-text">{{ consumeInfo.coupon_list.length }}</view>
|
||||
<view class="consume-type">{{ $lang("tool.pay.result.l37.t0") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="action">
|
||||
<template v-if="storeToken">
|
||||
<view v-if="paySource == 'recharge'" class="btn" @click="toRecharge()">{{ $lang("member.balance.l56") }}</view>
|
||||
<view v-else-if="paySource == 'membercard'" class="btn" @click="toCard()">{{ $lang("order._components.common-payment.l393.t0") }}</view>
|
||||
<view v-else-if="paySource == 'presale'" class="btn" @click="toPresaleOrder()">{{ $lang("tool.pay.result.l46.t0") }}</view>
|
||||
<view v-else-if="paySource == 'giftcard'" class="btn" @click="toOrder()">{{ $lang("tool.pay.result.l46.t0") }}</view>
|
||||
<view v-else-if="paySource == 'pointexchange'" class="btn" @click="toExchangeOrder()">查看订单
|
||||
</view>
|
||||
<view v-else class="btn" @click="toOrderDetail(payInfo.order_id)">{{ $lang("tool.pay.result.l46.t0") }}</view>
|
||||
</template>
|
||||
<view class="btn go-home" @click="goHome()">{{ $lang('common.empty.goHome') }}</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<ns-goods-recommend route="pay"></ns-goods-recommend>
|
||||
</template>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
payInfo: {},
|
||||
outTradeNo: '',
|
||||
paySource: '',
|
||||
consumeInfo: {},
|
||||
consumeStatus: 0,
|
||||
};
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.code) this.outTradeNo = option.code;
|
||||
this.paySource = uni.getStorageSync('paySource');
|
||||
},
|
||||
onShow() {
|
||||
this.getPayInfo();
|
||||
this.getConsume();
|
||||
},
|
||||
methods: {
|
||||
consume(type) {
|
||||
switch (type) {
|
||||
case 'point':
|
||||
this.$util.redirectTo('/pages_tool/member/point_detail', {});
|
||||
break;
|
||||
case 'growth':
|
||||
this.$util.redirectTo('/pages_tool/member/level', {});
|
||||
break;
|
||||
case 'coupon':
|
||||
this.$util.redirectTo('/pages_tool/member/coupon', {});
|
||||
break;
|
||||
default:
|
||||
this.$util.redirectTo(this.$util.MEMBER_PAGE_URL, {}, 'reLaunch');
|
||||
break;
|
||||
}
|
||||
},
|
||||
getConsume() {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberconsume/api/config/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
let reward = res.data.value;
|
||||
if (res.data.is_use && (reward.point_num > 0 || reward.growth_num > 0 || reward.coupon_list.length)) {
|
||||
this.consumeStatus = res.data.is_use;
|
||||
this.consumeInfo = res.data.value;
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
getPayInfo() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/info',
|
||||
data: {
|
||||
out_trade_no: this.outTradeNo
|
||||
},
|
||||
success: res => {
|
||||
if (res.code >= 0 && res.data) {
|
||||
this.payInfo = res.data;
|
||||
this.payInfo.pay_money = parseFloat(res.data.pay_money);
|
||||
this.payInfo.pay_money += parseFloat(res.data.balance);
|
||||
this.payInfo.pay_money += parseFloat(res.data.balance_money);
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: $lang('common.ns-payment.l185.t0')
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
||||
}, 1500);
|
||||
}
|
||||
},
|
||||
fail: res => {
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
goHome() {
|
||||
this.$util.redirectTo(this.$util.INDEX_PAGE_URL, {}, 'reLaunch');
|
||||
},
|
||||
toOrderDetail(id) {
|
||||
if (this.payInfo.order_type == 2) {
|
||||
this.$util.redirectTo('/pages_order/detail_pickup', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else if (this.payInfo.order_type == 3) {
|
||||
this.$util.redirectTo('/pages_order/detail_local_delivery', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else if (this.payInfo.order_type == 4) {
|
||||
this.$util.redirectTo('/pages_tool/order/detail_virtual', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
} else {
|
||||
this.$util.redirectTo('/pages_order/detail', {
|
||||
order_id: id
|
||||
}, 'redirectTo');
|
||||
}
|
||||
},
|
||||
toOrder(id) {
|
||||
this.$util.redirectTo('/pages_promotion/giftcard/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toRecharge() {
|
||||
this.$util.redirectTo('/pages_tool/recharge/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toCard() {
|
||||
this.$util.redirectTo('/pages_tool/member/card', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toPresaleOrder() {
|
||||
this.$util.redirectTo('/pages_promotion/presale/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
},
|
||||
toExchangeOrder() {
|
||||
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
|
||||
uni.setStorageSync('paySource', '');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.consume-box {
|
||||
padding: $padding;
|
||||
background: #F8F8F8;
|
||||
width: calc(100% - 48rpx);
|
||||
margin: 0 24rpx 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
border-radius: 20rpx;
|
||||
|
||||
.consume-head {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
font-weight: 500;
|
||||
font-size: 26rpx;
|
||||
|
||||
.consume-head-text {
|
||||
line-height: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.consume-list {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.consume-item {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
color: $color-title;
|
||||
font-size: $font-size-base;
|
||||
margin-top: 10rpx;
|
||||
|
||||
image {
|
||||
width: 24rpx;
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.consume-value {
|
||||
font-size: 26rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.consume-remark {
|
||||
color: $color-tip;
|
||||
font-size: $font-size-tag;
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.clear {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
|
||||
.result-box {
|
||||
padding-top: 94rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
background-color: #FFFFFF;
|
||||
width: 100%;
|
||||
padding-bottom: 40rpx;
|
||||
}
|
||||
|
||||
.result-image {
|
||||
width: 80rpx;
|
||||
height: auto;
|
||||
will-change: transform;
|
||||
}
|
||||
|
||||
.msg {
|
||||
font-size: 32rpx;
|
||||
margin-top: 25rpx;
|
||||
|
||||
&.success {
|
||||
color: #09BB07;
|
||||
}
|
||||
|
||||
&.fail {
|
||||
// P0: 失败提示色 → var(--base-color)
|
||||
// 兼容: 微信小程序 / 鸿蒙元服务 — color 接受 var() 无问题
|
||||
color: var(--base-color, #FF4646);
|
||||
}
|
||||
}
|
||||
|
||||
.pay-amount {
|
||||
font-size: 30rpx;
|
||||
margin: 40rpx 0 24rpx 0;
|
||||
font-weight: 600;
|
||||
line-height: 50rpx;
|
||||
|
||||
text {
|
||||
color: #333333 !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.unit {
|
||||
margin-right: 4rpx;
|
||||
}
|
||||
|
||||
.large {
|
||||
font-size: 60rpx !important;
|
||||
}
|
||||
|
||||
.small {
|
||||
font-size: 36rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.action {
|
||||
width: 100%;
|
||||
height: 80rpx;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
box-sizing: border-box;
|
||||
margin-top: 24rpx;
|
||||
|
||||
.btn {
|
||||
font-size: 30rpx;
|
||||
width: 200rpx;
|
||||
height: 66rpx;
|
||||
line-height: 66rpx;
|
||||
text-align: center;
|
||||
border-radius: 66rpx;
|
||||
border: 1px solid $color-tip;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:last-child {
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.go-home {
|
||||
background-color: $base-color;
|
||||
color: #fff;
|
||||
border-color: $base-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
::v-deep .goods-recommend {
|
||||
margin-top: 30rpx;
|
||||
}
|
||||
</style>
|
||||
|
||||
<style scoped>
|
||||
::v-deep .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
|
||||
max-height: unset !important;
|
||||
}
|
||||
</style>
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="mask-img">
|
||||
<image :src="$util.img('public/uniapp/pay/invite_friends_share.png')" mode="aspectFit" show-menu-by-longpress></image>
|
||||
</view>
|
||||
<view class="mask-word">点击右上角跳转到浏览器打开</view>
|
||||
<view class="mask-word">{{ $lang("tool.pay.wx_pay.l6.t0") }}</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,177 +1,177 @@
|
||||
<template>
|
||||
<view class="order-container" :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getListData">
|
||||
<block slot="list">
|
||||
<block v-if="orderList.length > 0">
|
||||
<view class="order-item" v-for="(orderItem, orderIndex) in orderList" :key="orderIndex">
|
||||
<view class="order-header">
|
||||
<view>
|
||||
<text class="color-tip font-size-tag">{{ orderItem.order_no }}</text>
|
||||
</view>
|
||||
<view class="align-right">
|
||||
<text class="color-tip font-size-tag">{{ $util.timeStampTurnTime(orderItem.create_time) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-body">
|
||||
<view class="goods_info_flex"><view class="goods-name font-size-base">充值成功</view></view>
|
||||
|
||||
<view class="goods-img color-base-text">
|
||||
¥
|
||||
<text>{{ orderItem.buy_price }}</text>
|
||||
</view>
|
||||
|
||||
<!-- <view class="goods-sub-section">
|
||||
<view class="<strong>goods-name</strong> color-tip " v-if="orderItem.point > 0 || orderItem.growth > 0">赠送:</view>
|
||||
<view class="goods-name color-tip " v-if="orderItem.point > 0">{{ orderItem.point }}积分</view>
|
||||
<view class="goods-name color-tip " v-if="orderItem.point > 0 && orderItem.growth > 0">、</view>
|
||||
<view class="goods-name color-tip " v-if="orderItem.growth > 0">{{ orderItem.growth }}成长值</view>
|
||||
<view class="goods-name color-tip " v-if="orderItem.point > 0 && orderItem.coupon_id">、</view>
|
||||
<view class="goods-name color-tip " v-if="orderItem.coupon_id">优惠券x{{ orderItem.coupon_id.split(',').length }}</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view v-else><ns-empty :isIndex="false" text="暂无充值记录"></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderList: []
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/recharge/order_list');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getListData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecharge/api/order/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.orderList = []; //如果是第一页需手动制空列表
|
||||
this.orderList = this.orderList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.orderList[index].cover_img = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.order-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.align-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.order-item {
|
||||
margin: $margin-updown $margin-both;
|
||||
padding: 0 30rpx;
|
||||
border-radius: $border-radius;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
|
||||
.order-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-bottom: 1px solid #e3e3e3;
|
||||
|
||||
& > view {
|
||||
flex: 1;
|
||||
line-height: 1;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.order-body {
|
||||
height: 155rpx;
|
||||
position: relative;
|
||||
|
||||
.goods_info_flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 30rpx;
|
||||
|
||||
.goods-name {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
line-height: 1;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-img {
|
||||
font-size: $font-size-tag;
|
||||
font-weight: 500;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 20rpx;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-sub-section {
|
||||
width: 100%;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
margin-top: 39rpx;
|
||||
font-size: $font-size-tag;
|
||||
|
||||
view {
|
||||
line-height: 1;
|
||||
text-align: right;
|
||||
margin-right: 10rpx;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view class="order-container" :style="themeColor">
|
||||
<mescroll-uni ref="mescroll" @getData="getListData">
|
||||
<block slot="list">
|
||||
<block v-if="orderList.length > 0">
|
||||
<view class="order-item" v-for="(orderItem, orderIndex) in orderList" :key="orderIndex">
|
||||
<view class="order-header">
|
||||
<view>
|
||||
<text class="color-tip font-size-tag">{{ orderItem.order_no }}</text>
|
||||
</view>
|
||||
<view class="align-right">
|
||||
<text class="color-tip font-size-tag">{{ $util.timeStampTurnTime(orderItem.create_time) }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="order-body">
|
||||
<view class="goods_info_flex"><view class="goods-name font-size-base">{{ $lang("tool.recharge.order_list.l16.t0") }}</view></view>
|
||||
|
||||
<view class="goods-img color-base-text">
|
||||
¥
|
||||
<text>{{ orderItem.buy_price }}</text>
|
||||
</view>
|
||||
|
||||
<!-- <view class="goods-sub-section">
|
||||
<view class="<strong>goods-name</strong> color-tip " v-if="orderItem.point > 0 || orderItem.growth > 0">{{ $lang("tool.recharge.order_list.l24.t0") }}</view>
|
||||
<view class="goods-name color-tip " v-if="orderItem.point > 0">{{ orderItem.point }}积分</view>
|
||||
<view class="goods-name color-tip " v-if="orderItem.point > 0 && orderItem.growth > 0">、</view>
|
||||
<view class="goods-name color-tip " v-if="orderItem.growth > 0">{{ orderItem.growth }}成长值</view>
|
||||
<view class="goods-name color-tip " v-if="orderItem.point > 0 && orderItem.coupon_id">、</view>
|
||||
<view class="goods-name color-tip " v-if="orderItem.coupon_id">{ $lang("tool.recharge.order_list.l29.t0") } orderItem.coupon_id.split(',').length }}</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view v-else><ns-empty :isIndex="false" text=$lang("tool.recharge.order_list.l34.t0")></ns-empty></view>
|
||||
</block>
|
||||
</mescroll-uni>
|
||||
<loading-cover ref="loadingCover"></loading-cover>
|
||||
<ns-login ref="login"></ns-login>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
orderList: []
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
|
||||
|
||||
if (!this.storeToken) {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.login.open('/pages_tool/recharge/order_list');
|
||||
});
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getListData(mescroll) {
|
||||
this.$api.sendRequest({
|
||||
url: '/memberrecharge/api/order/page',
|
||||
data: {
|
||||
page: mescroll.num,
|
||||
page_size: mescroll.size
|
||||
},
|
||||
success: res => {
|
||||
let newArr = [];
|
||||
let msg = res.message;
|
||||
if (res.code == 0 && res.data) {
|
||||
newArr = res.data.list;
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: msg
|
||||
});
|
||||
}
|
||||
mescroll.endSuccess(newArr.length);
|
||||
//设置列表数据
|
||||
if (mescroll.num == 1) this.orderList = []; //如果是第一页需手动制空列表
|
||||
this.orderList = this.orderList.concat(newArr); //追加新数据
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
},
|
||||
fail: res => {
|
||||
mescroll.endErr();
|
||||
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
|
||||
}
|
||||
});
|
||||
},
|
||||
imageError(index) {
|
||||
this.orderList[index].cover_img = this.$util.getDefaultImage().goods;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.order-container {
|
||||
width: 100vw;
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.align-right {
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.order-item {
|
||||
margin: $margin-updown $margin-both;
|
||||
padding: 0 30rpx;
|
||||
border-radius: $border-radius;
|
||||
background: #fff;
|
||||
position: relative;
|
||||
|
||||
.order-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position: relative;
|
||||
height: 80rpx;
|
||||
line-height: 80rpx;
|
||||
border-bottom: 1px solid #e3e3e3;
|
||||
|
||||
& > view {
|
||||
flex: 1;
|
||||
line-height: 1;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.order-body {
|
||||
height: 155rpx;
|
||||
position: relative;
|
||||
|
||||
.goods_info_flex {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
padding-top: 30rpx;
|
||||
|
||||
.goods-name {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
overflow: hidden;
|
||||
line-height: 1;
|
||||
font-weight: 500;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-img {
|
||||
font-size: $font-size-tag;
|
||||
font-weight: 500;
|
||||
position: absolute;
|
||||
right: 0;
|
||||
top: 20rpx;
|
||||
|
||||
text {
|
||||
font-size: $font-size-toolbar;
|
||||
}
|
||||
}
|
||||
|
||||
.goods-sub-section {
|
||||
width: 100%;
|
||||
line-height: 1;
|
||||
display: flex;
|
||||
margin-top: 39rpx;
|
||||
font-size: $font-size-tag;
|
||||
|
||||
view {
|
||||
line-height: 1;
|
||||
text-align: right;
|
||||
margin-right: 10rpx;
|
||||
font-size: $font-size-tag;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,199 +1,199 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="content">
|
||||
<view class="goods-attr">
|
||||
<view class="title">{{title}}</view>
|
||||
<view class="attr-wrap">
|
||||
<block v-for="(item, index) in list" :key="index">
|
||||
<view class="item">
|
||||
<text class="attr-name" :style="{background: item.background}">{{item.text}}</text>
|
||||
<text class="value-name" :style="{color: item.color}">{{item.value}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="g0>0">
|
||||
<view class="foot">
|
||||
<view @tap="generateImage" class="item" style="margin-right:30rpx;">导出图片</view>
|
||||
<view @tap="generatePdf" class="item">导出PDF</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: "搜索结果",
|
||||
info: {},
|
||||
list: [],
|
||||
keyword: "",
|
||||
g0: 1 // 默认显示导出按钮
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
themeColor() {
|
||||
return '#ffffff';
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.keyword) {
|
||||
this.keyword = options.keyword;
|
||||
}
|
||||
this.getdata();
|
||||
},
|
||||
onShow() {
|
||||
// 页面显示时执行
|
||||
},
|
||||
methods: {
|
||||
generatePdf() {
|
||||
const url = this.$util.img(this.info.files_url);
|
||||
uni.showLoading({ title: '正在加载' });
|
||||
try {
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.hideLoading();
|
||||
const filePath = res.tempFilePath;
|
||||
uni.shareFileMessage({
|
||||
filePath: filePath,
|
||||
success: () => {},
|
||||
fail: console.error
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
},
|
||||
complete: (res) => {
|
||||
if (res.statusCode === 404) {
|
||||
uni.showToast({ title: '文件不存在', icon: 'none' });
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
generateImage() {
|
||||
const url = this.$util.img(this.info.img_url);
|
||||
uni.showLoading({ title: '正在加载' });
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({ title: '保存成功' });
|
||||
},
|
||||
fail: (err) => {
|
||||
if (err.errMsg !== 'saveImageToPhotosAlbum:fail auth deny' && err.errMsg !== 'saveImageToPhotosAlbum:fail:auth denied') {
|
||||
this.$util.showToast({ title: '保存失败,请稍后重试' });
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({ title: '下载失败' });
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading();
|
||||
this.$util.showToast({ title: '下载失败' });
|
||||
}
|
||||
});
|
||||
},
|
||||
getdata() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/seal/info',
|
||||
data: { keyword: this.keyword },
|
||||
success: (res) => {
|
||||
this.list = res.value;
|
||||
this.info = res;
|
||||
this.title = res.name;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.goods-attr {
|
||||
margin: 24rpx 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.goods-attr .title {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 32rpx;
|
||||
margin: 0 20rpx;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.goods-attr .attr-wrap {
|
||||
margin: 20rpx;
|
||||
border: 2rpx solid #f1f1f1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.goods-attr .attr-wrap .item {
|
||||
display: flex;
|
||||
border-bottom: 2rpx solid #f1f1f1;
|
||||
}
|
||||
|
||||
.goods-attr .attr-wrap .item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.goods-attr .attr-wrap .item .attr-name {
|
||||
width: 200rpx;
|
||||
padding-right: 30rpx;
|
||||
background-color: #fbfafa;
|
||||
white-space: pre-wrap;
|
||||
border-right: 2rpx solid #f1f1f1;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
text-align: right;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.goods-attr .attr-wrap .item .value-name {
|
||||
padding-left: 30rpx;
|
||||
white-space: pre-wrap;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.foot {
|
||||
display: flex;
|
||||
margin: 40rpx 20rpx;
|
||||
}
|
||||
|
||||
.foot .item {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
background: #ff4646;
|
||||
padding: 10rpx 0;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
<template>
|
||||
<view>
|
||||
<view class="content">
|
||||
<view class="goods-attr">
|
||||
<view class="title">{{title}}</view>
|
||||
<view class="attr-wrap">
|
||||
<block v-for="(item, index) in list" :key="index">
|
||||
<view class="item">
|
||||
<text class="attr-name" :style="{background: item.background}">{{item.text}}</text>
|
||||
<text class="value-name" :style="{color: item.color}">{{item.value}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="g0>0">
|
||||
<view class="foot">
|
||||
<view @tap="generateImage" class="item" style="margin-right:30rpx;">{{ $lang("seal.medium.detail.l17") }}</view>
|
||||
<view @tap="generatePdf" class="item">{{ $lang("seal.medium.detail.l18") }}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
title: $lang("seal.medium.detail.l29"),
|
||||
info: {},
|
||||
list: [],
|
||||
keyword: "",
|
||||
g0: 1 // 默认显示导出按钮
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
themeColor() {
|
||||
return '#ffffff';
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.keyword) {
|
||||
this.keyword = options.keyword;
|
||||
}
|
||||
this.getdata();
|
||||
},
|
||||
onShow() {
|
||||
// 页面显示时执行
|
||||
},
|
||||
methods: {
|
||||
generatePdf() {
|
||||
const url = this.$util.img(this.info.files_url);
|
||||
uni.showLoading({ title: $lang('tool.cases.index.l143.t0') });
|
||||
try {
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.hideLoading();
|
||||
const filePath = res.tempFilePath;
|
||||
uni.shareFileMessage({
|
||||
filePath: filePath,
|
||||
success: () => {},
|
||||
fail: console.error
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: () => {
|
||||
uni.hideLoading();
|
||||
},
|
||||
complete: (res) => {
|
||||
if (res.statusCode === 404) {
|
||||
uni.showToast({ title: $lang('tool.cases.index.l167.t0'), icon: 'none' });
|
||||
}
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
uni.hideLoading();
|
||||
}
|
||||
},
|
||||
generateImage() {
|
||||
const url = this.$util.img(this.info.img_url);
|
||||
uni.showLoading({ title: $lang('tool.cases.index.l143.t0') });
|
||||
uni.downloadFile({
|
||||
url: url,
|
||||
success: (res) => {
|
||||
uni.hideLoading();
|
||||
if (res.statusCode === 200) {
|
||||
uni.saveImageToPhotosAlbum({
|
||||
filePath: res.tempFilePath,
|
||||
success: () => {
|
||||
this.$util.showToast({ title: $lang('goods._components.goods-detail-view.detail.l351.t0') });
|
||||
},
|
||||
fail: (err) => {
|
||||
if (err.errMsg !== 'saveImageToPhotosAlbum:fail auth deny' && err.errMsg !== 'saveImageToPhotosAlbum:fail:auth denied') {
|
||||
this.$util.showToast({ title: $lang('goods._components.goods-detail-view.detail.l356.t0') });
|
||||
}
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$util.showToast({ title: $lang('fenxiao.promote_code.l114') });
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
uni.hideLoading();
|
||||
this.$util.showToast({ title: $lang('fenxiao.promote_code.l114') });
|
||||
}
|
||||
});
|
||||
},
|
||||
getdata() {
|
||||
this.$api.sendRequest({
|
||||
url: '/api/seal/info',
|
||||
data: { keyword: this.keyword },
|
||||
success: (res) => {
|
||||
this.list = res.value;
|
||||
this.info = res;
|
||||
this.title = res.name;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.goods-attr {
|
||||
margin: 24rpx 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 16rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.goods-attr .title {
|
||||
height: 70rpx;
|
||||
line-height: 70rpx;
|
||||
box-sizing: border-box;
|
||||
font-size: 32rpx;
|
||||
margin: 0 20rpx;
|
||||
text-align: center;
|
||||
font-weight: 600;
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.goods-attr .attr-wrap {
|
||||
margin: 20rpx;
|
||||
border: 2rpx solid #f1f1f1;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.goods-attr .attr-wrap .item {
|
||||
display: flex;
|
||||
border-bottom: 2rpx solid #f1f1f1;
|
||||
}
|
||||
|
||||
.goods-attr .attr-wrap .item:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.goods-attr .attr-wrap .item .attr-name {
|
||||
width: 200rpx;
|
||||
padding-right: 30rpx;
|
||||
background-color: #fbfafa;
|
||||
white-space: pre-wrap;
|
||||
border-right: 2rpx solid #f1f1f1;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
text-align: right;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.goods-attr .attr-wrap .item .value-name {
|
||||
padding-left: 30rpx;
|
||||
white-space: pre-wrap;
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
font-size: 26rpx;
|
||||
flex: 1;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
.foot {
|
||||
display: flex;
|
||||
margin: 40rpx 20rpx;
|
||||
}
|
||||
|
||||
.foot .item {
|
||||
width: 50%;
|
||||
text-align: center;
|
||||
background: #ff4646;
|
||||
padding: 10rpx 0;
|
||||
color: #fff;
|
||||
border-radius: 10rpx;
|
||||
}
|
||||
</style>
|
||||
@@ -1,240 +1,240 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="content">
|
||||
<view class="cate-search">
|
||||
<view class="search-box">
|
||||
<input class="uni-input" maxlength="50" confirm-type="search" :focus="true" placeholder="请输入介质名称 '如汽油'" v-model="inputValue" @focus="inputFocus" @confirm="search" @input="inputChange" />
|
||||
<text @tap="search" class="iconfont icon-sousuo3"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-content">
|
||||
<block v-if="g0">
|
||||
<view class="history">
|
||||
<view class="history-box">
|
||||
<view class="history-top">
|
||||
<view class="title">搜索结果</view>
|
||||
</view>
|
||||
<view class="history-bottom">
|
||||
<block v-for="(item, index) in list" :key="index">
|
||||
<view @tap="otherSearch(item, index)" @longtap="deleteItem(item, index)" class="history-li">
|
||||
<view>{{item.name}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view>
|
||||
<ns-empty v-if="list.length === 0" isIndex="false" text="暂无数据"></ns-empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
inputValue: "",
|
||||
historyList: [],
|
||||
searchList: [],
|
||||
alikeList: [],
|
||||
isIndex: false,
|
||||
searchWords: "",
|
||||
hotList: [],
|
||||
isAllHistory: false,
|
||||
list: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
themeColor() {
|
||||
return '#ffffff';
|
||||
},
|
||||
g0() {
|
||||
return this.list.length;
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.keyword) {
|
||||
this.inputValue = options.keyword;
|
||||
}
|
||||
// 初始化搜索历史记录
|
||||
if (!uni.getStorageSync("search")) {
|
||||
uni.setStorageSync("search", []);
|
||||
}
|
||||
this.findHistoryList();
|
||||
// 可以在这里调用获取热门搜索列表的方法
|
||||
this.findHotList();
|
||||
},
|
||||
onShow() {
|
||||
this.$nextTick(() => {
|
||||
this.getHistoryHeight();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
findHistoryList() {
|
||||
this.historyList = uni.getStorageSync("search").reverse();
|
||||
},
|
||||
deleteHistoryList() {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确认删除全部历史记录?",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync("search", []);
|
||||
this.findHistoryList();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteItem(item, index) {
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "确认删除该条历史记录?",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
let search = uni.getStorageSync("search");
|
||||
search = search.filter((val) => val != item);
|
||||
uni.setStorageSync("search", search);
|
||||
this.findHistoryList();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
findHotList() {
|
||||
// 获取热门搜索列表
|
||||
this.$api.sendRequest({
|
||||
url: '/api/seal/hotlist',
|
||||
success: (res) => {
|
||||
this.hotList = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
inputFocus() {
|
||||
// 输入框聚焦事件
|
||||
},
|
||||
inputChange(e) {
|
||||
this.inputValue = e.target.value;
|
||||
},
|
||||
search() {
|
||||
if (!this.inputValue.trim()) {
|
||||
uni.showToast({ title: this.$lang('common.searchTip'), icon: 'none' });
|
||||
return;
|
||||
}
|
||||
// 保存搜索历史
|
||||
this.saveSearchHistory(this.inputValue);
|
||||
// 执行搜索
|
||||
this.$api.sendRequest({
|
||||
url: '/api/seal/search',
|
||||
data: { keyword: this.inputValue },
|
||||
success: (res) => {
|
||||
this.list = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
otherSearch(item, index) {
|
||||
// 其他搜索方式处理
|
||||
this.inputValue = item.name;
|
||||
this.search();
|
||||
},
|
||||
saveSearchHistory(keyword) {
|
||||
let search = uni.getStorageSync("search");
|
||||
// 去重
|
||||
search = search.filter((val) => val != keyword);
|
||||
search.unshift(keyword);
|
||||
// 限制历史记录数量
|
||||
if (search.length > 20) {
|
||||
search = search.slice(0, 20);
|
||||
}
|
||||
uni.setStorageSync("search", search);
|
||||
this.findHistoryList();
|
||||
},
|
||||
getHistoryHeight() {
|
||||
// 获取历史记录高度(如果需要)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
padding: 20rpx;
|
||||
background-color: #f8f8f8;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.cate-search {
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 25rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
|
||||
.uni-input {
|
||||
flex: 1;
|
||||
height: 60rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.iconfont.icon-sousuo3 {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.search-content {
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.history {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.history-box {
|
||||
border: 1rpx solid #f1f1f1;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.history-top {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #f1f1f1;
|
||||
}
|
||||
|
||||
.history-top .title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.history-bottom {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.history-li {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #f1f1f1;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.history-li:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.history-li:active {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
<template>
|
||||
<view>
|
||||
<view class="content">
|
||||
<view class="cate-search">
|
||||
<view class="search-box">
|
||||
<input class="uni-input" maxlength="50" confirm-type="search" :focus="true" placeholder="请输入介质名称 '如汽油'" v-model="inputValue" @focus="inputFocus" @confirm="search" @input="inputChange" />
|
||||
<text @tap="search" class="iconfont icon-sousuo3"></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="search-content">
|
||||
<block v-if="g0">
|
||||
<view class="history">
|
||||
<view class="history-box">
|
||||
<view class="history-top">
|
||||
<view class="title">{{ $lang("seal.medium.detail.l29") }}</view>
|
||||
</view>
|
||||
<view class="history-bottom">
|
||||
<block v-for="(item, index) in list" :key="index">
|
||||
<view @tap="otherSearch(item, index)" @longtap="deleteItem(item, index)" class="history-li">
|
||||
<view>{{item.name}}</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
<view>
|
||||
<ns-empty v-if="list.length === 0" isIndex="false" text=$lang("fenxiao.child_fenxiao.l32")></ns-empty>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
inputValue: "",
|
||||
historyList: [],
|
||||
searchList: [],
|
||||
alikeList: [],
|
||||
isIndex: false,
|
||||
searchWords: "",
|
||||
hotList: [],
|
||||
isAllHistory: false,
|
||||
list: []
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
themeColor() {
|
||||
return '#ffffff';
|
||||
},
|
||||
g0() {
|
||||
return this.list.length;
|
||||
}
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.keyword) {
|
||||
this.inputValue = options.keyword;
|
||||
}
|
||||
// 初始化搜索历史记录
|
||||
if (!uni.getStorageSync("search")) {
|
||||
uni.setStorageSync("search", []);
|
||||
}
|
||||
this.findHistoryList();
|
||||
// 可以在这里调用获取热门搜索列表的方法
|
||||
this.findHotList();
|
||||
},
|
||||
onShow() {
|
||||
this.$nextTick(() => {
|
||||
this.getHistoryHeight();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
findHistoryList() {
|
||||
this.historyList = uni.getStorageSync("search").reverse();
|
||||
},
|
||||
deleteHistoryList() {
|
||||
uni.showModal({
|
||||
title: $lang("common.wxwork-contact.l202.t0"),
|
||||
content: $lang("tool.goods.search.l86.t0"),
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.setStorageSync("search", []);
|
||||
this.findHistoryList();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteItem(item, index) {
|
||||
uni.showModal({
|
||||
title: $lang("common.wxwork-contact.l202.t0"),
|
||||
content: $lang("tool.goods.search.l99.t0"),
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
let search = uni.getStorageSync("search");
|
||||
search = search.filter((val) => val != item);
|
||||
uni.setStorageSync("search", search);
|
||||
this.findHistoryList();
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
findHotList() {
|
||||
// 获取热门搜索列表
|
||||
this.$api.sendRequest({
|
||||
url: '/api/seal/hotlist',
|
||||
success: (res) => {
|
||||
this.hotList = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
inputFocus() {
|
||||
// 输入框聚焦事件
|
||||
},
|
||||
inputChange(e) {
|
||||
this.inputValue = e.target.value;
|
||||
},
|
||||
search() {
|
||||
if (!this.inputValue.trim()) {
|
||||
uni.showToast({ title: this.$lang('common.search_tip'), icon: 'none' });
|
||||
return;
|
||||
}
|
||||
// 保存搜索历史
|
||||
this.saveSearchHistory(this.inputValue);
|
||||
// 执行搜索
|
||||
this.$api.sendRequest({
|
||||
url: '/api/seal/search',
|
||||
data: { keyword: this.inputValue },
|
||||
success: (res) => {
|
||||
this.list = res.data;
|
||||
}
|
||||
});
|
||||
},
|
||||
otherSearch(item, index) {
|
||||
// 其他搜索方式处理
|
||||
this.inputValue = item.name;
|
||||
this.search();
|
||||
},
|
||||
saveSearchHistory(keyword) {
|
||||
let search = uni.getStorageSync("search");
|
||||
// 去重
|
||||
search = search.filter((val) => val != keyword);
|
||||
search.unshift(keyword);
|
||||
// 限制历史记录数量
|
||||
if (search.length > 20) {
|
||||
search = search.slice(0, 20);
|
||||
}
|
||||
uni.setStorageSync("search", search);
|
||||
this.findHistoryList();
|
||||
},
|
||||
getHistoryHeight() {
|
||||
// 获取历史记录高度(如果需要)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
padding: 20rpx;
|
||||
background-color: #f8f8f8;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.cate-search {
|
||||
padding: 20rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.search-box {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: #f5f5f5;
|
||||
border-radius: 25rpx;
|
||||
padding: 10rpx 20rpx;
|
||||
}
|
||||
|
||||
.uni-input {
|
||||
flex: 1;
|
||||
height: 60rpx;
|
||||
font-size: 28rpx;
|
||||
color: #333;
|
||||
padding: 0 20rpx;
|
||||
}
|
||||
|
||||
.iconfont.icon-sousuo3 {
|
||||
font-size: 32rpx;
|
||||
color: #999;
|
||||
}
|
||||
|
||||
.search-content {
|
||||
background-color: #fff;
|
||||
border-radius: 10rpx;
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.history {
|
||||
margin-bottom: 20rpx;
|
||||
}
|
||||
|
||||
.history-box {
|
||||
border: 1rpx solid #f1f1f1;
|
||||
border-radius: 10rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.history-top {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #f1f1f1;
|
||||
}
|
||||
|
||||
.history-top .title {
|
||||
font-size: 30rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.history-bottom {
|
||||
padding: 20rpx;
|
||||
}
|
||||
|
||||
.history-li {
|
||||
padding: 20rpx;
|
||||
border-bottom: 1rpx solid #f1f1f1;
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.history-li:last-child {
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.history-li:active {
|
||||
background-color: #f5f5f5;
|
||||
}
|
||||
</style>
|
||||
@@ -1,114 +1,114 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="picker-container">
|
||||
<view v-for="(item, idx) in pickerList" :key="item.id" class="single-picker">
|
||||
<picker mode="selector" :value="item.value" :range="item.range" range-key="name" @change="bindPickerChange($event, idx, item)">
|
||||
<view class="picker">当前选择:{{item.range[item.value].name || '请选择'}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="answerName">
|
||||
<view style="font-size:32rpx;color:#ff0000;text-align:center;">
|
||||
<view style="color:#ff0000;">选型结果:</view>{{answerName}}
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="files_url">
|
||||
<view class="pdfcss" style="text-align:center;">
|
||||
<view @tap="onTapDoc" class="graphic-nav-item">
|
||||
<view style="display:flex;margin:10rpx;">
|
||||
<view style="flex:1;">
|
||||
<image style="width:50rpx;height:50rpx;" :src="g0" mode="widthFix" show-menu-by-longpress></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file_title">结果文件</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pickerList: [],
|
||||
answerName: '',
|
||||
files_url: '',
|
||||
g0: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
themeColor() {
|
||||
return '#ffffff';
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// 初始化数据
|
||||
this.files_url = '';
|
||||
this.g0 = this.files_url ? this.$util.img('addon/personnel/shop/view/enterprise/fileicon.png') : null;
|
||||
},
|
||||
methods: {
|
||||
bindPickerChange(e, idx, item) {
|
||||
// 处理选择器变化
|
||||
item.value = e.detail.value;
|
||||
this.$set(this.pickerList, idx, item);
|
||||
// 可以在这里添加逻辑,根据选择结果更新 answerName
|
||||
},
|
||||
onTapDoc() {
|
||||
// 处理文档点击事件
|
||||
if (this.files_url) {
|
||||
uni.downloadFile({
|
||||
url: this.files_url,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
success: (res) => {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.picker-container {
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 30rpx;
|
||||
}
|
||||
|
||||
.single-picker {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
border: solid 2rpx red;
|
||||
border-radius: 16rpx;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.picker {
|
||||
flex: 1;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 32rpx;
|
||||
width: 100%;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.file_title {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.graphic-nav-item {
|
||||
padding: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
<template>
|
||||
<view>
|
||||
<view class="picker-container">
|
||||
<view v-for="(item, idx) in pickerList" :key="item.id" class="single-picker">
|
||||
<picker mode="selector" :value="item.value" :range="item.range" range-key="name" @change="bindPickerChange($event, idx, item)">
|
||||
<view class="picker">{ $lang("seal.structure.l6") }item.range[item.value].name || $lang('common.ns-form.l37.t0')}}</view>
|
||||
</picker>
|
||||
</view>
|
||||
</view>
|
||||
<block v-if="answerName">
|
||||
<view style="font-size:32rpx;color:#ff0000;text-align:center;">
|
||||
<view style="color:#ff0000;">{{ $lang("seal.structure.l12") }}</view>{{answerName}}
|
||||
</view>
|
||||
</block>
|
||||
<block v-if="files_url">
|
||||
<view class="pdfcss" style="text-align:center;">
|
||||
<view @tap="onTapDoc" class="graphic-nav-item">
|
||||
<view style="display:flex;margin:10rpx;">
|
||||
<view style="flex:1;">
|
||||
<image style="width:50rpx;height:50rpx;" :src="g0" mode="widthFix" show-menu-by-longpress></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="file_title">{{ $lang("seal.structure.l23") }}</view>
|
||||
</view>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
pickerList: [],
|
||||
answerName: '',
|
||||
files_url: '',
|
||||
g0: ''
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
themeColor() {
|
||||
return '#ffffff';
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
// 初始化数据
|
||||
this.files_url = '';
|
||||
this.g0 = this.files_url ? this.$util.img('addon/personnel/shop/view/enterprise/fileicon.png') : null;
|
||||
},
|
||||
methods: {
|
||||
bindPickerChange(e, idx, item) {
|
||||
// 处理选择器变化
|
||||
item.value = e.detail.value;
|
||||
this.$set(this.pickerList, idx, item);
|
||||
// 可以在这里添加逻辑,根据选择结果更新 answerName
|
||||
},
|
||||
onTapDoc() {
|
||||
// 处理文档点击事件
|
||||
if (this.files_url) {
|
||||
uni.downloadFile({
|
||||
url: this.files_url,
|
||||
success: (res) => {
|
||||
if (res.statusCode === 200) {
|
||||
uni.openDocument({
|
||||
filePath: res.tempFilePath,
|
||||
success: (res) => {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.picker-container {
|
||||
padding: 20rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 30rpx;
|
||||
}
|
||||
|
||||
.single-picker {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 20rpx;
|
||||
border: solid 2rpx red;
|
||||
border-radius: 16rpx;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.picker {
|
||||
flex: 1;
|
||||
padding: 20rpx;
|
||||
border-radius: 10rpx;
|
||||
font-size: 32rpx;
|
||||
width: 100%;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.file_title {
|
||||
font-size: 28rpx;
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.graphic-nav-item {
|
||||
padding: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@@ -38,13 +38,13 @@ export default {
|
||||
},
|
||||
computed: {
|
||||
textVal() {
|
||||
return '该店铺已打烊...';
|
||||
return $lang('tool.storeclose.l41.t0');
|
||||
},
|
||||
pageVal() {
|
||||
if (this.$store.state.siteState == -2) {
|
||||
return '店铺不存在';
|
||||
return $lang('tool.storeclose.l45.t0');
|
||||
} else if (this.$store.state.siteState == -3) {
|
||||
return '店铺打烊';
|
||||
return $lang('tool.storeclose.l47.t0');
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1,48 +1,48 @@
|
||||
<template>
|
||||
<view>
|
||||
<view class="error-msg">{{errorMsg}}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
outTradeNo:'',
|
||||
errorMsg:'',
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.merchant_trade_no){
|
||||
this.outTradeNo = option.merchant_trade_no;
|
||||
this.getOrderDetailPath();
|
||||
}else{
|
||||
this.errorMsg = '缺少merchant_trade_no参数';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getOrderDetailPath(){
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/outTradeNoToOrderDetailPath',
|
||||
data:{
|
||||
out_trade_no : this.outTradeNo,
|
||||
},
|
||||
success: res => {
|
||||
if (res.code < 0) {
|
||||
this.errorMsg = res.message || '未知错误';
|
||||
}else{
|
||||
this.$util.redirectTo(res.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.error-msg{
|
||||
text-align: center;
|
||||
padding-top: 10vh;
|
||||
}
|
||||
</style>
|
||||
<template>
|
||||
<view>
|
||||
<view class="error-msg">{{errorMsg}}</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
outTradeNo:'',
|
||||
errorMsg:'',
|
||||
}
|
||||
},
|
||||
onLoad(option) {
|
||||
if (option.merchant_trade_no){
|
||||
this.outTradeNo = option.merchant_trade_no;
|
||||
this.getOrderDetailPath();
|
||||
}else{
|
||||
this.errorMsg = $lang('tool.weapp.order_shipping.l20.t0');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getOrderDetailPath(){
|
||||
this.$api.sendRequest({
|
||||
url: '/api/pay/outTradeNoToOrderDetailPath',
|
||||
data:{
|
||||
out_trade_no : this.outTradeNo,
|
||||
},
|
||||
success: res => {
|
||||
if (res.code < 0) {
|
||||
this.errorMsg = res.message || $lang('tool.weapp.order_shipping.l32.t0');
|
||||
}else{
|
||||
this.$util.redirectTo(res.data);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.error-msg{
|
||||
text-align: center;
|
||||
padding-top: 10vh;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user