revert: 所有代码与custom/common分支同

This commit is contained in:
2026-01-05 15:56:49 +08:00
parent 8ef6975ee1
commit 60a0e5133e
219 changed files with 14860 additions and 15585 deletions

View File

@@ -12,8 +12,7 @@
<scroll-view scroll-x>
<block v-for="(item, index) in dateArr" :key="index">
<div class="flex-box" @click="selectDateEvent(index, item)">
<view class="date-box"
:style="{ color: index == dateActive ? selectedTabColor : '#909399' }">
<view class="date-box" :style="{ color: index == dateActive ? selectedTabColor : '#909399' }">
<text>{{ item.week }} {{ item.date }}</text>
</view>
</div>
@@ -31,9 +30,7 @@
<view class="time-box" v-if="!isSection">
<block v-for="(item, _index) in timeArr" :key="_index">
<view class="item">
<view class="item-box diy"
:class="{ disable: item.disable, active: isMultiple ? item.isActive : _index == timeActive }"
@click="selectTimeEvent(_index, item)">
<view class="item-box diy" :class="{ disable: item.disable, active: isMultiple ? item.isActive : _index == timeActive }" @click="selectTimeEvent(_index, item)">
<!-- :style="{ color: isMultiple ? (item.isActive ? selectedItemColor : '#333') : _index == timeActive ? selectedItemColor : '#333' }" -->
<text>{{ item.time }}</text>
<!-- <text class="all">{{ item.disable ? disableText : undisableText }}</text> -->
@@ -46,9 +43,7 @@
<view class="time-box" v-else>
<block v-for="(item, _index) in timeArr" :key="_index">
<view class="item">
<view class="item-box"
:class="{ disable: item.disable || item.isInclude, active: item.time == timeQuanBegin || item.time == timeQuanEnd }"
@click="handleSelectQuantum(_index, item)">
<view class="item-box" :class="{ disable: item.disable || item.isInclude, active: item.time == timeQuanBegin || item.time == timeQuanEnd }" @click="handleSelectQuantum(_index, item)">
<!-- :style="{ color: item.time == timeQuanBegin || item.time == timeQuanEnd ? selectedItemColor : '#333' }" -->
<text>{{ item.time }}</text>
<text class="all">{{ item.disable ? disableText : undisableText }}</text>
@@ -71,349 +66,349 @@
</template>
<script>
// 插件地址https://ext.dcloud.net.cn/plugin?id=3593
import {
initData,
initTime,
timeStamp,
currentTime,
strFormat,
weekDate
} from './yuyue-date.js';
export default {
name: 'times',
model: {
prop: 'showPop',
event: 'change'
},
props: {
isMultiple: {
//是否多选
type: Boolean,
default: false
// 插件地址https://ext.dcloud.net.cn/plugin?id=3593
import {
initData,
initTime,
timeStamp,
currentTime,
strFormat,
weekDate
} from './yuyue-date.js';
export default {
name: 'times',
model: {
prop: 'showPop',
event: 'change'
},
isSection: {
//预约时间段
type: Boolean,
default: false
},
advanceTime: {
//提前预约时间
type: [String, Number],
default: "0"
},
disableText: {
//禁用显示的文本
type: String,
default: '已约满'
},
undisableText: {
//未禁用显示的文本
type: String,
default: '可预约'
},
timeInterval: {
// 时间间隔,小时为单位
type: String,
default: "1"
},
selectedTabColor: {
// 日期栏选中的颜色
type: String,
default: '#303133'
},
selectedItemColor: {
// 时间选中的颜色
type: String,
default: '#D50AEF'
},
beginTime: {
type: String,
default: '09:00'
},
endTime: {
type: String,
default: '19:00'
},
appointTime: {
// 预约的时间
type: Array,
default() {
return [];
}
},
disableTimeSlot: {
// 预约开始和结束时间,来禁用时间段
type: Object,
default() {
return {};
}
},
disableWeek: {
// 限制周几不可以预约
type: Array,
default() {
return [];
}
}
},
watch: {
appointTime: {
handler(val) {
if (val && val.length) {
this.initOnload();
props: {
isMultiple: {
//是否多选
type: Boolean,
default: false
},
isSection: {
//预约时间段
type: Boolean,
default: false
},
advanceTime: {
//提前预约时间
type: [String, Number],
default: "0"
},
disableText: {
//禁用显示的文本
type: String,
default: '已约满'
},
undisableText: {
//未禁用显示的文本
type: String,
default: '可预约'
},
timeInterval: {
// 时间间隔,小时为单位
type: String,
default: "1"
},
selectedTabColor: {
// 日期栏选中的颜色
type: String,
default: '#303133'
},
selectedItemColor: {
// 时间选中的颜色
type: String,
default: '#D50AEF'
},
beginTime: {
type: String,
default: '09:00'
},
endTime: {
type: String,
default: '19:00'
},
appointTime: {
// 预约的时间
type: Array,
default () {
return [];
}
},
disableTimeSlot: {
// 预约开始和结束时间,来禁用时间段
type: Object,
default () {
return {};
}
},
disableWeek: {
// 限制周几不可以预约
type: Array,
default () {
return [];
}
}
},
beginTime: function (nVal, oVal) {
this.initOnload();
this.handleSubmit();
},
endTime: function (nVal, oVal) {
this.initOnload();
this.handleSubmit();
},
},
data() {
return {
pickerStartDay: '', // 指定开始日期
pickerEndDay: '', // 指定结束日期
orderDateTime: '暂无选择', // 选中时间
orderTimeArr: {}, //多选的时间
dateArr: [], //日期数据
timeArr: [], //时间数据
nowDate: '', // 当前日期
dateActive: 0, //选中的日期索引
timeActive: 0, //选中的时间索引
timeQuanBeginIndex: 0, //时间段开始的下标
selectDate: '', //选择的日期
selectTime: '', //选择的时间
timeQuanBegin: '', //时间段开始时间
timeQuanEnd: '' //时间段结束时间
};
},
created(props) {
this.selectDate = this.nowDate = currentTime().date;
this.pickerStartDay = currentTime().year + '-' + currentTime().date;
const now = new Date(this.pickerStartDay).getTime(); //获取当前日期的时间戳
let timeStr = 3600 * 24 * 1000; //一天的时间戳
let day = 90; // 未来3个月
this.pickerEndDay = timeStamp(now + timeStr * day).allDate;
this.initOnload();
this.dateArr = initData(); // 日期栏初始化
},
methods: {
open() {
this.$refs.timePopup.open();
},
close() {
this.$refs.timePopup.close();
},
// 指定时间
change(e) {
let date = e.split("-");
date = date[1] + "-" + date[2];
if (this.disableWeek.length && date >= weekDate()[0] && date <= weekDate()[1]) {
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
let index = new Date(e).getDay();
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
uni.showToast({
title: weekBox[index] + '不可以预约',
icon: 'none'
})
return false;
watch: {
appointTime: {
handler(val) {
if (val && val.length) {
this.initOnload();
}
}
}
this.initOnload(e);
this.dateArr = initData(e); // 日期栏初始化
this.selectDateEvent(0, this.dateArr[0]);
},
beginTime: function(nVal, oVal) {
this.initOnload();
this.handleSubmit();
},
endTime: function(nVal, oVal) {
this.initOnload();
this.handleSubmit();
},
},
initOnload(appointedDay) {
this.timeArr = initTime(this.beginTime, this.endTime, parseFloat(this.timeInterval)); //时间选项初始化
this.timeQuanBegin = this.timeQuanEnd = '';
let isFullTime = true;
this.timeArr.forEach((item, index) => {
// 判断默认是不能选择的周,则都禁止选中
if (this.disableWeek.length && this.selectDate >= weekDate()[0] && this.selectDate <=
weekDate()[1]) {
data() {
return {
pickerStartDay: '', // 指定开始日期
pickerEndDay: '', // 指定结束日期
orderDateTime: '暂无选择', // 选中时间
orderTimeArr: {}, //多选的时间
dateArr: [], //日期数据
timeArr: [], //时间数据
nowDate: '', // 当前日期
dateActive: 0, //选中的日期索引
timeActive: 0, //选中的时间索引
timeQuanBeginIndex: 0, //时间段开始的下标
selectDate: '', //选择的日期
selectTime: '', //选择的时间
timeQuanBegin: '', //时间段开始时间
timeQuanEnd: '' //时间段结束时间
};
},
created(props) {
this.selectDate = this.nowDate = currentTime().date;
this.pickerStartDay = currentTime().year + '-' + currentTime().date;
const now = new Date(this.pickerStartDay).getTime(); //获取当前日期的时间戳
let timeStr = 3600 * 24 * 1000; //一天的时间戳
let day = 90; // 未来3个月
this.pickerEndDay = timeStamp(now + timeStr * day).allDate;
this.initOnload();
this.dateArr = initData(); // 日期栏初始化
},
methods: {
open() {
this.$refs.timePopup.open();
},
close() {
this.$refs.timePopup.close();
},
// 指定时间
change(e) {
let date = e.split("-");
date = date[1] + "-" + date[2];
if (this.disableWeek.length && date >= weekDate()[0] && date <= weekDate()[1]) {
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
let date = currentTime().year + '-' + this.selectDate;
let index = new Date(date).getDay();
let index = new Date(e).getDay();
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
item.disable = true;
uni.showToast({
title: weekBox[index] + '不可以预约',
icon: 'none'
})
return false;
}
}
this.initOnload(e);
this.dateArr = initData(e); // 日期栏初始化
this.selectDateEvent(0, this.dateArr[0]);
},
initOnload(appointedDay) {
this.timeArr = initTime(this.beginTime, this.endTime, parseFloat(this.timeInterval)); //时间选项初始化
this.timeQuanBegin = this.timeQuanEnd = '';
let isFullTime = true;
this.timeArr.forEach((item, index) => {
// 判断默认是不能选择的周,则都禁止选中
if (this.disableWeek.length && this.selectDate >= weekDate()[0] && this.selectDate <=
weekDate()[1]) {
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
let date = currentTime().year + '-' + this.selectDate;
let index = new Date(date).getDay();
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
item.disable = true;
}
}
//判断是当前这一天,选中时间小于当前时间则禁用
if (this.selectDate == this.nowDate && currentTime().time > item.time) {
item.disable = true;
}
// 将提前预约的时间禁用 advanceTime
var advTime = new Date(new Date().setMinutes(new Date().getMinutes() + parseInt(this.advanceTime) * 60));
var advTimeStr = strFormat(advTime.getHours()) + ":" + strFormat(advTime.getMinutes()) + ":" + strFormat(advTime.getSeconds());
var advTimeStr1 = strFormat(advTime.getMonth() + 1) + "-" + strFormat(advTime.getDate());
if (this.selectDate == advTimeStr1 && advTimeStr > item.time || advTimeStr1 > this.selectDate) {
item.disable = true;
}
// 将预约的时间禁用
this.appointTime.forEach(t => {
let [date, time] = t.split(' ');
time = time.slice(0, -3);
if (date == currentTime().year + '-' + this.selectDate && item.time == time ||
date == currentTime().year + '-' + advTimeStr1 && item.time == time) {
//判断是当前这一天,选中时间小于当前时间则禁用
if (this.selectDate == this.nowDate && currentTime().time > item.time) {
item.disable = true;
}
// 将提前预约的时间禁用 advanceTime
var advTime = new Date(new Date().setMinutes(new Date().getMinutes() + parseInt(this.advanceTime) * 60));
var advTimeStr = strFormat(advTime.getHours()) + ":" + strFormat(advTime.getMinutes()) + ":" + strFormat(advTime.getSeconds());
var advTimeStr1 = strFormat(advTime.getMonth() + 1) + "-" + strFormat(advTime.getDate());
if (this.selectDate == advTimeStr1 && advTimeStr > item.time || advTimeStr1 > this.selectDate) {
item.disable = true;
}
// 将预约的时间禁用
this.appointTime.forEach(t => {
let [date, time] = t.split(' ');
time = time.slice(0, -3);
if (date == currentTime().year + '-' + this.selectDate && item.time == time ||
date == currentTime().year + '-' + advTimeStr1 && item.time == time) {
item.disable = true;
}
});
// 禁用时间段
const cur_time = `${this.selectDate} ${item.time}`;
const {
begin_time,
end_time
} = this.disableTimeSlot;
if (begin_time && end_time && (begin_time <= cur_time && cur_time <= end_time)) {
item.disable = true;
}
// 判断是否当前日期时间都被预约
if (!item.disable) {
isFullTime = false;
}
this.isSection && (item.isInclude = false);
});
// 禁用时间段
const cur_time = `${this.selectDate} ${item.time}`;
const {
begin_time,
end_time
} = this.disableTimeSlot;
if (begin_time && end_time && (begin_time <= cur_time && cur_time <= end_time)) {
item.disable = true;
}
// 判断是否当前日期时间都被预约
if (!item.disable) {
isFullTime = false;
}
this.isSection && (item.isInclude = false);
});
this.orderDateTime = isFullTime ? '暂无选择' : this.selectDate;
this.timeActive = -1;
for (let i = 0, len = this.timeArr.length; i < len; i++) {
if (!this.timeArr[i].disable) {
this.orderDateTime = {
data: `${this.selectDate}`,
time: `${this.timeArr[i].time}`
};
this.timeActive = i;
return;
}
}
},
// 日期选择事件
selectDateEvent(index, item) {
if (this.disableWeek.length && item.date >= weekDate()[0] && item.date <= weekDate()[1]) {
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
let index = new Date(item.timeStamp).getDay();
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
uni.showToast({
title: weekBox[index] + '不可以预约',
icon: 'none'
})
return false;
}
}
this.dateActive = index;
this.selectDate = item.date;
this.initOnload();
this.handleSubmit();
},
// 时间选择事件
selectTimeEvent(index, item) {
if (item.disable) return;
if (this.isMultiple) {
item.isActive = !item.isActive;
this.timeArr = this.timeArr.slice();
this.orderTimeArr[this.selectDate] = this.timeArr.reduce((prev, cur) => {
cur.isActive && prev.push(cur.time);
return prev;
}, []);
} else {
this.timeActive = index;
this.selectTime = item.time;
this.orderDateTime = {
data: `${this.selectDate}`,
time: `${item.time}`
};
}
this.handleSubmit();
},
// 选择时间段
handleSelectQuantum(index, item) {
if (item.disable) return;
function clearTime() {
this.timeQuanBeginIndex = index;
this.timeQuanBegin = item.time;
this.timeQuanEnd = '';
}
if (!this.timeQuanBegin) {
clearTime.call(this);
return;
}
if (!this.timeQuanEnd && this.timeQuanBegin) {
let isDisble = false;
let start = this.timeQuanBeginIndex;
let end = index;
start > end && ([start, end] = [end, start]);
for (let i = start + 1; i < end; i++) {
if (this.timeArr[i].disable) {
isDisble = true;
clearTime.call(this);
this.orderDateTime = isFullTime ? '暂无选择' : this.selectDate;
this.timeActive = -1;
for (let i = 0, len = this.timeArr.length; i < len; i++) {
if (!this.timeArr[i].disable) {
this.orderDateTime = {
data: `${this.selectDate}`,
time: `${this.timeArr[i].time}`
};
this.timeActive = i;
return;
}
}
if (!isDisble) {
for (let i = start + 1; i < end; i++) {
this.timeArr[i].isInclude = true;
},
// 日期选择事件
selectDateEvent(index, item) {
if (this.disableWeek.length && item.date >= weekDate()[0] && item.date <= weekDate()[1]) {
let weekBox = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
let index = new Date(item.timeStamp).getDay();
if (this.disableWeek.indexOf(weekBox[index]) != -1) {
uni.showToast({
title: weekBox[index] + '不可以预约',
icon: 'none'
})
return false;
}
}
this.timeQuanEnd = item.time;
return;
}
if (this.timeQuanBegin && this.timeQuanEnd) {
this.timeArr.forEach(t => {
t.isInclude = false;
});
clearTime.call(this);
}
},
handleChange() {
this.timeQuanBegin > this.timeQuanEnd && ([this.timeQuanBegin, this.timeQuanEnd] = [this.timeQuanEnd, this.timeQuanBegin]);
},
handleSubmit() {
if (this.isSection) {
this.handleChange();
this.$emit('change', {
beginTime: `${this.selectDate} ${this.timeQuanBegin}`,
endTime: `${this.selectDate} ${this.timeQuanEnd}`
});
return;
}
this.dateActive = index;
this.selectDate = item.date;
this.initOnload();
this.handleSubmit();
},
if (this.isMultiple) {
let time = [];
for (let date in this.orderTimeArr) {
this.orderTimeArr[date].forEach(item => {
time.push(`${date} ${item}`);
// 时间选择事件
selectTimeEvent(index, item) {
if (item.disable) return;
if (this.isMultiple) {
item.isActive = !item.isActive;
this.timeArr = this.timeArr.slice();
this.orderTimeArr[this.selectDate] = this.timeArr.reduce((prev, cur) => {
cur.isActive && prev.push(cur.time);
return prev;
}, []);
} else {
this.timeActive = index;
this.selectTime = item.time;
this.orderDateTime = {
data: `${this.selectDate}`,
time: `${item.time}`
};
}
this.handleSubmit();
},
// 选择时间段
handleSelectQuantum(index, item) {
if (item.disable) return;
function clearTime() {
this.timeQuanBeginIndex = index;
this.timeQuanBegin = item.time;
this.timeQuanEnd = '';
}
if (!this.timeQuanBegin) {
clearTime.call(this);
return;
}
if (!this.timeQuanEnd && this.timeQuanBegin) {
let isDisble = false;
let start = this.timeQuanBeginIndex;
let end = index;
start > end && ([start, end] = [end, start]);
for (let i = start + 1; i < end; i++) {
if (this.timeArr[i].disable) {
isDisble = true;
clearTime.call(this);
return;
}
}
if (!isDisble) {
for (let i = start + 1; i < end; i++) {
this.timeArr[i].isInclude = true;
}
}
this.timeQuanEnd = item.time;
return;
}
if (this.timeQuanBegin && this.timeQuanEnd) {
this.timeArr.forEach(t => {
t.isInclude = false;
});
clearTime.call(this);
}
},
handleChange() {
this.timeQuanBegin > this.timeQuanEnd && ([this.timeQuanBegin, this.timeQuanEnd] = [this.timeQuanEnd, this.timeQuanBegin]);
},
handleSubmit() {
if (this.isSection) {
this.handleChange();
this.$emit('change', {
beginTime: `${this.selectDate} ${this.timeQuanBegin}`,
endTime: `${this.selectDate} ${this.timeQuanEnd}`
});
return;
}
if (this.isMultiple) {
let time = [];
for (let date in this.orderTimeArr) {
this.orderTimeArr[date].forEach(item => {
time.push(`${date} ${item}`);
});
}
this.$emit('change', time);
} else {
// this.$emit('change', currentTime().year + '-' + this.orderDateTime);
this.$emit('change', {
date: currentTime().year + '-' + this.orderDateTime.data,
time: this.orderDateTime.time
});
}
this.$emit('change', time);
} else {
// this.$emit('change', currentTime().year + '-' + this.orderDateTime);
this.$emit('change', {
date: currentTime().year + '-' + this.orderDateTime.data,
time: this.orderDateTime.time
});
}
}
}
};
};
</script>
<style lang="scss" scoped>
@import './yuyue-date.scss';
@import './yuyue-date.scss';
</style>

View File

@@ -152,14 +152,11 @@
</template>
<script>
import validate from '@/common/js/validate.js';
import fenxiaoWords from '@/common/js/fenxiao-words.js';
import htmlParser from '@/common/js/html-parser.js';
import validate from 'common/js/validate.js';
import uniPopup from '@/components/uni-popup/uni-popup.vue';
import fenxiaoWords from 'common/js/fenxiao-words.js';
import htmlParser from '@/common/js/html-parser';
export default {
components: {
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
},
data() {
return {
isChecked: false,
@@ -190,6 +187,9 @@
isOpen: false
};
},
components: {
uniPopup
},
mixins: [fenxiaoWords],
onLoad(option) {
setTimeout( () => {

View File

@@ -3,8 +3,7 @@
<mescroll-uni ref="mescroll" @getData="getData" class="member-point" :size="8">
<block slot="list">
<view class="balances" v-if="accountList.length" v-for="item in accountList" :key="item.id">
<image v-if="item.type == 'order'" :src="$util.img('public/uniapp/fenxiao/bill/jiesuan.png')"
mode="widthFix"></image>
<image v-if="item.type == 'order'" :src="$util.img('public/uniapp/fenxiao/bill/jiesuan.png')" mode="widthFix"></image>
<image v-else :src="$util.img('public/uniapp/fenxiao/bill/withdraw.png')" mode="widthFix"></image>
<view class="balances-info">
<text>{{ item.type_name }}</text>
@@ -12,8 +11,7 @@
<text>{{ $util.timeStampTurnTime(item.create_time) }}</text>
</view>
<view class="balances-num">
<text :class="item.money > 0 ? 'color-base-text' : ''">{{ item.money > 0 ? '+' + item.money :
item.money }}</text>
<text :class="item.money > 0 ? 'color-base-text' : ''">{{ item.money > 0 ? '+' + item.money : item.money }}</text>
</view>
</view>
<ns-empty v-if="!accountList.length && showEmpty" text="暂无账单信息" :isIndex="false"></ns-empty>
@@ -24,25 +22,32 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
},
data() {
return {
accountList: {},
showEmpty: true
};
},
components: {
nsLogin,
MescrollUni,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
onShow() {
setTimeout(() => {
setTimeout( () => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
@@ -53,7 +58,7 @@ export default {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
}, 1000);
},1000);
},
methods: {
getData(mescroll) {

View File

@@ -40,24 +40,31 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
},
data() {
return {
teamList: [],
emptyShow: false,
};
},
components: {
nsLogin,
MescrollUni,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
mixins: [fenxiaoWords],
onShow() {
setTimeout(() => {

View File

@@ -1,329 +0,0 @@
<template>
<view class="container" :style="themeColor">
<view class="level-top">
<image :src="$util.img('public/uniapp/level/level-top-bg.png')"></image>
</view>
<swiper :autoplay="false" :duration="500" class="level-swiper" previous-margin="50rpx" next-margin="50rpx"
@change="swiperChange" :current="curr">
<swiper-item v-for="(item, index) in levelList" :key="index">
<view class="level-item" :class="{ 'curr': index == curr }">
<view class="level-wrap">
<view class="member-info">
<view class="head-img">
<image
:src="fenxiaoInfo.headimg ? $util.img(fenxiaoInfo.headimg) : $util.getDefaultImage().head"
@error="fenxiaoInfo.headimg = $util.getDefaultImage().head" mode="aspectFill" />
</view>
<view class="nickname">{{ fenxiaoInfo.nickname }}</view>
<view class="level-name">{{ item.level_name }}</view>
</view>
<view class="level-rate">
<view class="rate-item" v-if="config.level > 0">
<view class="title">一级分佣比率</view>
<view class="rate">{{ item.one_rate }}<text class="percentage">%</text></view>
</view>
<view class="rate-item" v-if="config.level > 1">
<view class="title">二级分佣比率</view>
<view class="rate">{{ item.two_rate }}<text class="percentage">%</text></view>
</view>
<view class="rate-item" v-if="config.level > 2">
<view class="title">三级分佣比率</view>
<view class="rate">{{ item.three_rate }}<text class="percentage">%</text></view>
</view>
</view>
<view class="not-unlocked" v-if="item.level_num > fenxiaoInfo.level_num">
<text class="iconfont icon-suoding"></text>
</view>
</view>
</view>
</swiper-item>
</swiper>
<view class="level-condition" v-if="levelInfo">
<view class="condition-title">
<view class="title">快速升级技巧</view>
<view class="rate price-font">
<text class="complete">{{ levelInfo.complete > levelInfo.task_num ? levelInfo.task_num :
levelInfo.complete }}</text>
<text class="num">/{{ levelInfo.task_num }}</text>
</view>
</view>
<view class="task">
<view class="task-item" v-for="(item, index) in levelInfo.task" :key="index">
<view class="flex-box">
<view class="title">
{{ item.title }}
<text class="iconfont icon-wenxiao" @click="openTips(item)"></text>
</view>
<view class="status" :class="{ 'complete': item.progress == 100 }">
{{ item.progress == 100 ? '已完成' : '未完成' }}</view>
</view>
<view class="progress">
<progress :percent="item.progress" activeColor="#E7B667" stroke-width="4" />
</view>
<view class="flex-box">
<view class="desc">{{ item.desc }}</view>
<view class="rate price-font">
<text class="complete">{{ item.value }}</text>
<text class="num">/{{ item.condition }}</text>
</view>
</view>
</view>
</view>
</view>
<uni-popup type="bottom" ref="tips">
<view class="popup">
<view class="popup-header">
<text class="tit">提示</text>
<text class="iconfont icon-close" @click="$refs.tips.close()"></text>
</view>
<view class="popup-body">
<view>{{ tips }}</view>
<view v-if="levelInfo">{{ levelInfo.upgrade_type == 1 ? '满足任意一条件即可升级' : '满足全部条件才能进行升级' }}</view>
</view>
</view>
</uni-popup>
<ns-goods-recommend route="fenxiao_level"></ns-goods-recommend>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
nsGoodsRecommend: () => import('@/components/ns-goods-recommend/ns-goods-recommend.vue'),
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
},
data() {
return {
fenxiaoInfo: {
condition: {
last_level: null
}
},
config: {},
levelList: [],
curr: 0,
tips: ''
};
},
mixins: [fenxiaoWords],
computed: {
levelInfo() {
if (this.levelList.length) {
let level = this.levelList[this.curr];
level.task = [];
level.complete = 0;
if (level.one_fenxiao_order_num > 0) {
let task = {
title: '下级消费',
desc: '下级消费单数满' + level.one_fenxiao_order_num + '单',
tips: '分销商自己购买和自己推荐的直属会员购买的订单次数达到' + level.one_fenxiao_order_num + '单',
condition: level.one_fenxiao_order_num,
value: this.fenxiaoInfo.one_fenxiao_order_num,
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_order_num) > parseFloat(level.one_fenxiao_order_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_order_num) / parseFloat(level.one_fenxiao_order_num) * 100).toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.one_fenxiao_total_order > 0) {
let task = {
title: '下级消费',
desc: '下级消费金额满' + this.moneyFormat(level.one_fenxiao_total_order) + '元',
tips: '分销商自己购买和推荐的直属会员购买的订单的总额达到' + this.moneyFormat(level.one_fenxiao_total_order) + '元',
condition: this.moneyFormat(level.one_fenxiao_total_order),
value: this.fenxiaoInfo.one_fenxiao_total_order,
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_total_order) > parseFloat(level.one_fenxiao_total_order) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_total_order) / parseFloat(level.one_fenxiao_total_order) * 100)
.toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.one_fenxiao_order_money > 0) {
let task = {
title: '下级消费',
desc: '下级消费产生佣金总额满' + this.moneyFormat(level.one_fenxiao_order_money) + '元',
tips: '分销商自己购买和自己推荐的直属会员购买的订单佣金总额达到' + this.moneyFormat(level.one_fenxiao_order_money) + '元',
condition: this.moneyFormat(level.one_fenxiao_order_money),
value: this.fenxiaoInfo.one_fenxiao_order_money,
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_order_money) > parseFloat(level.one_fenxiao_order_money) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_order_money) / parseFloat(level.one_fenxiao_order_money) * 100)
.toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.order_num > 0) {
let task = {
title: '自身消费',
desc: '自身消费单数满' + level.order_num + '单',
tips: '分销商自己购买的订单次数达到' + level.order_num + '单',
condition: level.order_num,
value: this.fenxiaoInfo.order_num,
progress: parseFloat(this.fenxiaoInfo.order_num) > parseFloat(level.order_num) ? 100 : (parseFloat(this.fenxiaoInfo.order_num) / parseFloat(level.order_num) * 100).toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.order_money > 0) {
let task = {
title: '自身消费',
desc: '自身消费金额满' + this.moneyFormat(level.order_money) + '元',
tips: '分销商自己购买的订单总额满足' + this.moneyFormat(level.order_money) + '元',
condition: this.moneyFormat(level.order_money),
value: this.fenxiaoInfo.order_money,
progress: parseFloat(this.fenxiaoInfo.order_money) > parseFloat(level.order_money) ? 100 : (parseFloat(this.fenxiaoInfo.order_money) / parseFloat(level.order_money) * 100).toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.one_child_num > 0) {
let task = {
title: '邀请好友',
desc: '邀请好友人数达到' + level.one_child_num + '人',
tips: '分销商的直属下级会员人数达到' + level.one_child_num + '人(包含已经申请成为分销商的)',
condition: level.one_child_num,
value: this.fenxiaoInfo.one_child_num,
progress: parseFloat(this.fenxiaoInfo.one_child_num) > parseFloat(level.one_child_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_child_num) / parseFloat(level.one_child_num) * 100).toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.one_child_fenxiao_num > 0) {
let task = {
title: '邀请好友',
desc: '邀请好友成为分销商人数达到' + level.one_child_fenxiao_num + '人',
tips: '分销商的直属下级分销商人数达到' + level.one_child_fenxiao_num + '人',
condition: level.one_child_fenxiao_num,
value: this.fenxiaoInfo.one_child_fenxiao_num,
progress: parseFloat(this.fenxiaoInfo.one_child_fenxiao_num) > parseFloat(level.one_child_fenxiao_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_child_fenxiao_num) / parseFloat(level.one_child_fenxiao_num) * 100).toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
level.task_num = level.upgrade_type == 1 ? 1 : level.task.length;
return level;
}
}
},
onLoad() { },
onShow() {
setTimeout(() => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
mask: true,
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
}, 1000);
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '等级');
if (this.storeToken) {
this.getFenxiaoInfo();
this.getBasicsConfig();
} else {
this.$util.redirectTo('/pages_tool/login/login', {
back: '/pages_promotion/fenxiao/level'
});
}
},
methods: {
/**
* 获取分销等级信息
*/
getFenxiaoLevel() {
this.$api.sendRequest({
url: '/fenxiao/api/Level/lists',
success: res => {
if (res.code == 0 && res.data) {
this.levelList = res.data;
this.levelList.forEach((item, index) => {
if (item.level_id == this.fenxiaoInfo.level_id) this.curr = index;
})
}
}
});
},
/**
* 获取分销商信息
*/
getFenxiaoInfo() {
this.$api.sendRequest({
url: '/fenxiao/api/fenxiao/detail',
success: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
if (res.code >= 0 && res.data) {
this.fenxiaoInfo = res.data;
this.curr = this.fenxiaoInfo.level_num;
this.getFenxiaoLevel();
} else {
this.$util.redirectTo('/pages_promotion/fenxiao/apply');
}
},
fail: () => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
/**
* 获取分销基本配置
*/
getBasicsConfig() {
this.$api.sendRequest({
url: '/fenxiao/api/config/basics',
success: res => {
if (res.code >= 0) {
this.config = res.data;
}
}
});
},
swiperChange(e) {
this.curr = e.detail.current;
},
moneyFormat(money) {
if (isNaN(parseFloat(money))) return money;
return parseFloat(money).toFixed(2);
},
openTips(data) {
this.tips = data.tips;
this.$refs.tips.open();
}
}
};
</script>
<style lang="scss">
@import '@/pages_promotion/fenxiao/public/css/level.scss';
</style>
<style scoped lang="scss">
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
/deep/ .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
/deep/ .uni-popup {
z-index: 8;
}
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
</style>

View File

@@ -1,314 +0,0 @@
<template>
<view class="container" :style="themeColor">
<swiper class="swiper" @change="getIndex">
<swiper-item v-for="(item, index) in poster" :key="index">
<view class="swiper-item">
<view class="poster-wrap">
<image :src="$util.img(item)" mode="widthFix" :show-menu-by-longpress="true" />
</view>
</view>
</swiper-item>
</swiper>
<!-- #ifdef H5 -->
<view class="tips">长按识别图中二维码</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class="btn color-base-bg color-base-border" @click="save">保存海报</view>
<!-- #endif -->
<uni-popup ref="popupDialog" :custom="true" :mask-click="false">
<view class="dialog-popup">
<view class="title">提示</view>
<view class="message">您拒绝了保存图片到相册的授权请求无法保存图片到相册如需正常使用请授权之后再进行操作</view>
<view class="action-wrap">
<view @click="closeDialog">取消</view>
<view>
<button type="default" open-type="openSetting" @opensetting="closeDialog"
hover-class="none">立即授权</button>
</view>
</view>
</view>
</uni-popup>
<ns-login ref="login"></ns-login>
<loading-cover ref="loadingCover"></loading-cover>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
</view>
</template>
<script>
import {
Weixin
} from 'common/js/wx-jssdk.js';
export default {
components: {
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
},
data() {
return {
poster: [],
fenxiaoInfo: {},
posterIndex: 0,
//海报模板id
templateId: ['default'],
mpShareData: null //小程序分享数据
};
},
methods: {
/**
* 获取分销海报
*/
getPoster(id) {
return new Promise((resolve, reject) => {
this.$api.sendRequest({
url: '/fenxiao/api/fenxiao/poster',
data: {
page: '/pages/index/index',
qrcode_param: JSON.stringify({}),
template_id: id
},
success: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
if (res.code >= 0) {
resolve(res.data.path);
}
},
fail: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
reject();
}
});
});
},
getIndex(e) {
this.posterIndex = e.detail.current;
},
save() {
// #ifdef MP
uni.downloadFile({
url: this.$util.img(this.poster[this.posterIndex]),
success: res => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
this.$util.showToast({
title: '保存成功'
});
},
fail: res => {
if (res.errMsg == 'saveImageToPhotosAlbum:fail auth deny' ||
res.errMsg == 'saveImageToPhotosAlbum:fail:auth denied') {
this.$refs.popupDialog.open();
} else {
this.$util.showToast({
title: '保存失败,请稍后重试'
});
}
}
});
} else {
this.$util.showToast({
title: '下载失败'
});
}
},
fail: res => {
this.$util.showToast({
title: '下载失败'
});
}
});
// #endif
},
getFenxiaoDetail() {
this.poster = [];
try {
this.templateId.forEach((item, index) => {
this.getPoster(item).then(resolve => {
this.poster.push(resolve);
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}).catch(reject => {
throw reject;
});
});
} catch {
this.$util.showToast({
title: '海报生成失败'
});
}
},
closeDialog() {
this.$refs.popupDialog.close();
}
},
onLoad(option) {
setTimeout(() => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
mask: true,
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
}, 1000);
if (option.templateId) {
this.templateId = option.templateId.split(',');
}
if (this.storeToken) {
if (option.poster) {
this.poster = decodeURIComponent(option.poster).split(',')
setTimeout(() => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}, 500)
} else {
this.getFenxiaoDetail();
}
} else {
this.$nextTick(() => {
this.$refs.login.open('/pages_promotion/fenxiao/promote_code');
});
}
},
onShow() {
//小程序分享
// #ifdef MP-WEIXIN
this.$util.getMpShare().then(res => {
this.mpShareData = res;
});
// #endif
},
//分享给好友
onShareAppMessage() {
return this.mpShareData.appMessage;
},
//分享到朋友圈
onShareTimeline() {
return this.mpShareData.timeLine;
},
watch: {
storeToken: function (nVal, oVal) {
if (nVal) {
this.getFenxiaoDetail();
}
}
}
};
</script>
<style lang="scss">
.container {
width: 100vw;
min-height: 100vh;
background-color: #f5f5f5;
}
.poster-wrap {
padding: 40rpx 0;
width: calc(100vw - 80rpx);
margin: 0 40rpx;
line-height: 1;
image {
border-radius: 20rpx;
overflow: hidden;
width: 100%;
}
}
.swiper {
height: 1240rpx;
}
.btn {
margin: 0 80rpx;
margin-top: 30rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: $border-radius;
color: #fff;
text-align: center;
}
.tips {
text-align: center;
font-size: $font-size-base;
color: #999;
font-weight: 600;
margin-top: 20rpx;
}
.dialog-popup {
width: 580rpx;
background: #fff;
box-sizing: border-box;
border-radius: 10rpx;
overflow: hidden;
height: initial;
.title {
padding: 30rpx 30rpx 0 30rpx;
text-align: center;
font-size: 32rpx;
font-weight: bold;
}
.message {
padding: 0 30rpx;
color: #666;
text-align: center;
font-size: $font-size-base;
line-height: 1.3;
margin-top: 30rpx;
}
.action-wrap {
margin-top: 50rpx;
height: 80rpx;
display: flex;
border-top: 2rpx solid #eee;
&>view {
flex: 1;
text-align: center;
line-height: 80rpx;
&:first-child {
border-right: 2rpx solid #eee;
color: #999;
}
button {
border: none;
line-height: 80rpx;
padding: 0;
margin: 0;
width: 100%;
height: 100%;
}
}
}
}
</style>

View File

@@ -2,28 +2,28 @@
<view class="content" :style="themeColor">
<mescroll-uni ref="mescroll" @getData="getGoodsList">
<block slot="list">
<view class="goods-list"
:style="{ backgroundImage: 'url(' + $util.img('public/uniapp/fenxiao/promote/promote_bg.png') + ')' }">
<view class="goods-list" :style="{ backgroundImage: 'url(' + $util.img('public/uniapp/fenxiao/promote/promote_bg.png') + ')' }">
<scroll-view class="quick-nav" scroll-x="true">
<!-- #ifdef MP -->
<view class="uni-scroll-view-content">
<!-- #endif -->
<view class="quick-nav-item" :class="{ selected: categoryId == 0 }"
@click="changeCategory(0)">全部</view>
<view class="quick-nav-item" v-for="item in categoryList" :key="item.category_id"
<view class="quick-nav-item" :class="{ selected: categoryId == 0 }" @click="changeCategory(0)">全部</view>
<view
class="quick-nav-item"
v-for="item in categoryList"
:key="item.category_id"
:class="{ selected: categoryId == item.category_id }"
@click="changeCategory(item.category_id)">
@click="changeCategory(item.category_id)"
>
{{ item.category_name }}
</view>
<!-- #ifdef MP -->
</view>
<!-- #endif -->
</scroll-view>
<view v-for="(item, index) in goodsList" :key="index" class="goods-item"
@click="navToDetailPage(item)">
<view v-for="(item, index) in goodsList" :key="index" class="goods-item" @click="navToDetailPage(item)">
<view class="image-wrap">
<image :src="$util.img(item.sku_image, { size: 'mid' })" @error="imageError(index)"
mode="aspectFill" />
<image :src="$util.img(item.sku_image, { size: 'mid' })" @error="imageError(index)" mode="aspectFill" />
</view>
<view class="goods-content">
<view class="goods-name">
@@ -132,18 +132,24 @@
</template>
<script>
import list from '@/pages_promotion/fenxiao/public/js/goods_list.js';
import fenxiaoWords from '@/common/js/fenxiao-words.js';
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import list from './public/js/goods_list.js';
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsLogin,
MescrollUni,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
privacyPopup
// #endif
},
mixins: [list, fenxiaoWords]
@@ -151,7 +157,7 @@ export default {
</script>
<style>
.quick-nav>>>.uni-scroll-view-content {
.quick-nav >>> .uni-scroll-view-content {
display: flex;
}
</style>
@@ -159,10 +165,8 @@ export default {
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
.quick-nav {
margin-bottom: 20rpx;
.quick-nav-item {
display: flex;
align-items: center;
@@ -186,7 +190,6 @@ export default {
}
}
}
.content {
overflow: hidden;
padding: 0 30rpx 160rpx;
@@ -199,14 +202,12 @@ export default {
background-size: 100%;
background-repeat: no-repeat;
box-sizing: border-box;
.goods-item {
margin-bottom: 20rpx;
background: #ffffff;
padding: $padding;
display: flex;
border-radius: 10rpx;
&:last-child {
margin-bottom: 0;
}
@@ -220,7 +221,6 @@ export default {
border-radius: 10rpx;
overflow: hidden;
flex-shrink: 0;
image {
width: 100%;
height: 100%;
@@ -241,7 +241,6 @@ export default {
.goods-name {
width: 100%;
line-height: 1.3;
.name {
line-height: 1.3;
word-break: break-all;
@@ -251,12 +250,10 @@ export default {
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
}
.label-list {
display: flex;
align-items: center;
margin-top: 6rpx;
.label-item {
padding: 4rpx 10rpx;
font-size: $font-size-tag;
@@ -288,7 +285,6 @@ export default {
padding: 0 $padding;
border-radius: 50rpx;
border: 2rpx solid $base-color;
text {
color: $base-color;
border-radius: 40rpx;
@@ -303,7 +299,6 @@ export default {
}
}
}
.active-btn {
position: fixed;
bottom: 40rpx;
@@ -317,12 +312,10 @@ export default {
border-radius: 50rpx;
background-color: $base-color;
color: #fff;
.btn {
flex: 1;
text-align: center;
}
.share-btn {
margin: 0;
padding: 0;
@@ -362,7 +355,6 @@ export default {
border: none;
line-height: 1;
height: auto;
text {
margin-top: 20rpx;
font-size: $font-size-tag;
@@ -375,7 +367,6 @@ export default {
font-size: 80rpx;
line-height: initial;
}
.icon-fuzhilianjie,
.icon-pengyouquan,
.icon-haowuquan,
@@ -392,48 +383,39 @@ export default {
text-align: center;
}
}
.poster-layer {
.generate-poster {
padding: 40rpx 0;
.iconfont {
font-size: 80rpx;
color: #07c160;
line-height: initial;
}
>view {
> view {
text-align: center;
&:last-child {
margin-top: 20rpx;
}
}
}
.image-wrap {
width: 64%;
height: 854rpx;
margin: 60rpx auto 40rpx auto;
box-shadow: 0 0 32rpx rgba(100, 100, 100, 0.3);
image {
width: 480rpx;
height: 854rpx;
}
}
.msg {
padding: 40rpx;
}
.save {
text-align: center;
height: 80rpx;
line-height: 80rpx;
}
.close {
position: absolute;
top: 0;

View File

@@ -261,25 +261,11 @@
<script>
import fenxiaoWords from '@/common/js/fenxiao-words.js';
import uniPopup from '@/components/uni-popup/uni-popup.vue';
export default {
components: {
nsSelectTime: () => import('@/components/ns-select-time/ns-select-time.vue'),
uniTag: () => import('@/components/uni-tag/uni-tag.vue'),
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
nsGoodsSkuIndex: () => import('@/components/ns-goods-sku/ns-goods-sku-index.vue'),
uniNumberBox: () => import('@/components/uni-number-box/uni-number-box.vue'),
nsGoodsSku: () => import('@/components/ns-goods-sku/ns-goods-sku.vue'),
toTop: () => import('@/components/toTop/toTop.vue'),
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
nsGoodsRecommend: () => import('@/components/ns-goods-recommend/ns-goods-recommend.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsPayment: () => import('@/components/payment/payment.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
uniPopup
},
data() {
return {
@@ -597,9 +583,10 @@ export default {
};
</script>
<style lang="scss">
@import './public/css/index.scss';
</style>
<style scoped lang="scss">
@import '@/pages_promotion/fenxiao/public/css/index.scss';
/deep/ .uni-popup__wrapper {
height: auto;
}

View File

@@ -0,0 +1,319 @@
<template>
<view class="container" :style="themeColor">
<view class="level-top">
<image :src="$util.img('public/uniapp/level/level-top-bg.png')"></image>
</view>
<swiper :autoplay="false" :duration="500" class="level-swiper" previous-margin="50rpx" next-margin="50rpx" @change="swiperChange" :current="curr">
<swiper-item v-for="(item, index) in levelList" :key="index">
<view class="level-item" :class="{'curr': index == curr}">
<view class="level-wrap">
<view class="member-info">
<view class="head-img">
<image :src="fenxiaoInfo.headimg ? $util.img(fenxiaoInfo.headimg) : $util.getDefaultImage().head" @error="fenxiaoInfo.headimg = $util.getDefaultImage().head" mode="aspectFill"/>
</view>
<view class="nickname">{{ fenxiaoInfo.nickname }}</view>
<view class="level-name">{{ item.level_name }}</view>
</view>
<view class="level-rate">
<view class="rate-item" v-if="config.level > 0">
<view class="title">一级分佣比率</view>
<view class="rate">{{ item.one_rate }}<text class="percentage">%</text></view>
</view>
<view class="rate-item" v-if="config.level > 1">
<view class="title">二级分佣比率</view>
<view class="rate">{{ item.two_rate }}<text class="percentage">%</text></view>
</view>
<view class="rate-item" v-if="config.level > 2">
<view class="title">三级分佣比率</view>
<view class="rate">{{ item.three_rate }}<text class="percentage">%</text></view>
</view>
</view>
<view class="not-unlocked" v-if="item.level_num > fenxiaoInfo.level_num">
<text class="iconfont icon-suoding"></text>
</view>
</view>
</view>
</swiper-item>
</swiper>
<view class="level-condition" v-if="levelInfo">
<view class="condition-title">
<view class="title">快速升级技巧</view>
<view class="rate price-font">
<text class="complete">{{ levelInfo.complete > levelInfo.task_num ? levelInfo.task_num : levelInfo.complete }}</text>
<text class="num">/{{ levelInfo.task_num }}</text>
</view>
</view>
<view class="task">
<view class="task-item" v-for="(item, index) in levelInfo.task" :key="index">
<view class="flex-box">
<view class="title">
{{item.title}}
<text class="iconfont icon-wenxiao" @click="openTips(item)"></text>
</view>
<view class="status" :class="{'complete': item.progress == 100}">
{{ item.progress == 100 ? '已完成' : '未完成' }}</view>
</view>
<view class="progress">
<progress :percent="item.progress" activeColor="#E7B667" stroke-width="4" />
</view>
<view class="flex-box">
<view class="desc">{{item.desc}}</view>
<view class="rate price-font">
<text class="complete">{{ item.value }}</text>
<text class="num">/{{ item.condition }}</text>
</view>
</view>
</view>
</view>
</view>
<uni-popup type="bottom" ref="tips">
<view class="popup">
<view class="popup-header">
<text class="tit">提示</text>
<text class="iconfont icon-close" @click="$refs.tips.close()"></text>
</view>
<view class="popup-body">
<view>{{ tips }}</view>
<view v-if="levelInfo">{{ levelInfo.upgrade_type == 1 ? '满足任意一条件即可升级' : '满足全部条件才能进行升级' }}</view>
</view>
</view>
</uni-popup>
<ns-goods-recommend route="fenxiao_level"></ns-goods-recommend>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
data() {
return {
fenxiaoInfo: {
condition: {
last_level: null
}
},
config: {},
levelList: [],
curr: 0,
tips: ''
};
},
mixins: [fenxiaoWords],
computed: {
levelInfo() {
if (this.levelList.length) {
let level = this.levelList[this.curr];
level.task = [];
level.complete = 0;
if (level.one_fenxiao_order_num > 0) {
let task = {
title: '下级消费',
desc: '下级消费单数满' + level.one_fenxiao_order_num + '单',
tips: '分销商自己购买和自己推荐的直属会员购买的订单次数达到'+ level.one_fenxiao_order_num + '单',
condition: level.one_fenxiao_order_num,
value: this.fenxiaoInfo.one_fenxiao_order_num,
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_order_num) > parseFloat(level.one_fenxiao_order_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_order_num) / parseFloat(level.one_fenxiao_order_num) * 100).toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.one_fenxiao_total_order > 0) {
let task = {
title: '下级消费',
desc: '下级消费金额满' + this.moneyFormat(level.one_fenxiao_total_order) + '元',
tips: '分销商自己购买和推荐的直属会员购买的订单的总额达到'+ this.moneyFormat(level.one_fenxiao_total_order) + '元',
condition: this.moneyFormat(level.one_fenxiao_total_order),
value: this.fenxiaoInfo.one_fenxiao_total_order,
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_total_order) > parseFloat(level.one_fenxiao_total_order) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_total_order) / parseFloat(level.one_fenxiao_total_order) * 100)
.toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.one_fenxiao_order_money > 0) {
let task = {
title: '下级消费',
desc: '下级消费产生佣金总额满' + this.moneyFormat(level.one_fenxiao_order_money) + '元',
tips: '分销商自己购买和自己推荐的直属会员购买的订单佣金总额达到'+ this.moneyFormat(level.one_fenxiao_order_money) + '元',
condition: this.moneyFormat(level.one_fenxiao_order_money),
value: this.fenxiaoInfo.one_fenxiao_order_money,
progress: parseFloat(this.fenxiaoInfo.one_fenxiao_order_money) > parseFloat(level.one_fenxiao_order_money) ? 100 : (parseFloat(this.fenxiaoInfo.one_fenxiao_order_money) / parseFloat(level.one_fenxiao_order_money) * 100)
.toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.order_num > 0) {
let task = {
title: '自身消费',
desc: '自身消费单数满' + level.order_num + '单',
tips: '分销商自己购买的订单次数达到'+ level.order_num + '单',
condition: level.order_num,
value: this.fenxiaoInfo.order_num,
progress: parseFloat(this.fenxiaoInfo.order_num) > parseFloat(level.order_num) ? 100 : (parseFloat(this.fenxiaoInfo.order_num) / parseFloat(level.order_num) * 100).toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.order_money > 0) {
let task = {
title: '自身消费',
desc: '自身消费金额满' + this.moneyFormat(level.order_money) + '元',
tips: '分销商自己购买的订单总额满足'+ this.moneyFormat(level.order_money) + '元',
condition: this.moneyFormat(level.order_money),
value: this.fenxiaoInfo.order_money,
progress: parseFloat(this.fenxiaoInfo.order_money) > parseFloat(level.order_money) ? 100 : (parseFloat(this.fenxiaoInfo.order_money) / parseFloat(level.order_money) * 100).toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.one_child_num > 0) {
let task = {
title: '邀请好友',
desc: '邀请好友人数达到' + level.one_child_num + '人',
tips: '分销商的直属下级会员人数达到'+level.one_child_num+'人(包含已经申请成为分销商的)',
condition: level.one_child_num,
value: this.fenxiaoInfo.one_child_num,
progress: parseFloat(this.fenxiaoInfo.one_child_num) > parseFloat(level.one_child_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_child_num) / parseFloat(level.one_child_num) * 100).toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
if (level.one_child_fenxiao_num > 0) {
let task = {
title: '邀请好友',
desc: '邀请好友成为分销商人数达到' + level.one_child_fenxiao_num + '人',
tips: '分销商的直属下级分销商人数达到'+ level.one_child_fenxiao_num + '人',
condition: level.one_child_fenxiao_num,
value: this.fenxiaoInfo.one_child_fenxiao_num,
progress: parseFloat(this.fenxiaoInfo.one_child_fenxiao_num) > parseFloat(level.one_child_fenxiao_num) ? 100 : (parseFloat(this.fenxiaoInfo.one_child_fenxiao_num) / parseFloat(level.one_child_fenxiao_num) * 100).toFixed(2)
}
if (task.progress == 100) level.complete += 1;
level.task.push(task);
}
level.task_num = level.upgrade_type == 1 ? 1 : level.task.length;
return level;
}
}
},
onLoad() {},
onShow() {
setTimeout( () => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
mask: true,
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
},1000);
if (this.fenxiaoWords && this.fenxiaoWords.fenxiao_name) this.$langConfig.title(this.fenxiaoWords.fenxiao_name + '等级');
if (this.storeToken) {
this.getFenxiaoInfo();
this.getBasicsConfig();
} else {
this.$util.redirectTo('/pages_tool/login/login', {
back: '/pages_promotion/fenxiao/level'
});
}
},
methods: {
/**
* 获取分销等级信息
*/
getFenxiaoLevel() {
this.$api.sendRequest({
url: '/fenxiao/api/Level/lists',
success: res => {
if (res.code == 0 && res.data) {
this.levelList = res.data;
this.levelList.forEach((item, index) => {
if (item.level_id == this.fenxiaoInfo.level_id) this.curr = index;
})
}
}
});
},
/**
* 获取分销商信息
*/
getFenxiaoInfo() {
this.$api.sendRequest({
url: '/fenxiao/api/fenxiao/detail',
success: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
if (res.code >= 0 && res.data) {
this.fenxiaoInfo = res.data;
this.curr = this.fenxiaoInfo.level_num;
this.getFenxiaoLevel();
} else {
this.$util.redirectTo('/pages_promotion/fenxiao/apply');
}
},
fail: () => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
/**
* 获取分销基本配置
*/
getBasicsConfig() {
this.$api.sendRequest({
url: '/fenxiao/api/config/basics',
success: res => {
if (res.code >= 0) {
this.config = res.data;
}
}
});
},
swiperChange(e) {
this.curr = e.detail.current;
},
moneyFormat(money) {
if (isNaN(parseFloat(money))) return money;
return parseFloat(money).toFixed(2);
},
openTips(data) {
this.tips = data.tips;
this.$refs.tips.open();
}
}
};
</script>
<style lang="scss">
@import './public/css/level.scss';
</style>
<style scoped lang="scss">
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
/deep/ .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
/deep/ .uni-popup {
z-index: 8;
}
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
</style>

View File

@@ -2,51 +2,40 @@
<view :style="themeColor">
<view class="withdraw-cate">
<block v-for="(item, index) in category" :key="index">
<view @click="selectCate(item.id)" class="cate-li"
:class="{ 'active color-base-text color-base-bg-before': selectId == item.id }">{{ item.name }}
</view>
<view @click="selectCate(item.id)" class="cate-li" :class="{ 'active color-base-text color-base-bg-before': selectId == item.id }">{{ item.name }}</view>
</block>
</view>
<mescroll-uni ref="mescroll" @getData="getData" top="90" class="member-point" :size="8" v-if="storeToken">
<view class="goods_list" slot="list">
<view class="order-list">
<view class="order-item" v-for="(orderItem, orderIndex) in orderList" :key="orderIndex"
@click="toDetail(orderItem.fenxiao_order_id)">
<view class="order-item" v-for="(orderItem, orderIndex) in orderList" :key="orderIndex" @click="toDetail(orderItem.fenxiao_order_id)">
<view class="order-header">
<text class="site-name font-size-base">{{ orderItem.order_no }}</text>
<text class="status-name color-base-text" v-if="orderItem.is_refund == 1">已退款</text>
<text class="status-name color-text-green"
v-else-if="orderItem.is_settlement == 1">已结算</text>
<text class="status-name color-text-green" v-else-if="orderItem.is_settlement == 1">已结算</text>
<text class="status-name color-text-orange" v-else>待结算</text>
</view>
<view class="order-body">
<view class="goods-wrap">
<view class="goods-img">
<image :src="$util.img(orderItem.sku_image, { size: 'mid' })"
@error="imageError(orderIndex)" mode="aspectFill" :lazy-load="true"></image>
<image :src="$util.img(orderItem.sku_image, { size: 'mid' })" @error="imageError(orderIndex)" mode="aspectFill" :lazy-load="true"></image>
</view>
<view class="goods-info">
<view class="top-wrap">
<view class="goods-name font-size-base">{{ orderItem.sku_name }}</view>
<view>
<text class="color-tip">{{ fenxiaoWords.account }}</text>
<text class="price-color price-style small">{{
$lang('common.currencySymbol') }}</text>
<text class="price-color price-style large">{{
parseFloat(orderItem.commission).toFixed(2).split(".")[0] }}</text>
<text class="price-color price-style small">.{{
parseFloat(orderItem.commission).toFixed(2).split(".")[1] }}</text>
<text class="price-color price-style small">{{ $lang('common.currencySymbol') }}</text>
<text class="price-color price-style large" >{{ parseFloat(orderItem.commission).toFixed(2).split(".")[0] }}</text>
<text class="price-color price-style small">.{{ parseFloat(orderItem.commission).toFixed(2).split(".")[1] }}</text>
</view>
</view>
<view class="goods-sub-section">
<view class="goods-price">
<text class="unit price-style small">{{ $lang('common.currencySymbol')
}}</text>
<text class="price-color price-style large">{{
parseFloat(orderItem.price).toFixed(2).split(".")[0] }}</text>
<text class="unit price-style small">.{{
parseFloat(orderItem.price).toFixed(2).split(".")[1] }}</text>
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
<text class="price-color price-style large" >{{ parseFloat(orderItem.price).toFixed(2).split(".")[0] }}</text>
<text class="unit price-style small">.{{ parseFloat(orderItem.price).toFixed(2).split(".")[1] }}</text>
</view>
<view>
<text>
@@ -68,24 +57,18 @@
<view class="total">
<text>合计</text>
<text class="price-color">{{ $lang('common.currencySymbol') }}</text>
<text class="price-color font-size-toolbar">{{
parseFloat(orderItem.real_goods_money).toFixed(2).split(".")[0] }}</text>
<text class="price-color">.{{
parseFloat(orderItem.real_goods_money).toFixed(2).split(".")[1] }}</text>
<text class="price-color font-size-toolbar" >{{ parseFloat(orderItem.real_goods_money).toFixed(2).split(".")[0] }}</text>
<text class="price-color">.{{ parseFloat(orderItem.real_goods_money).toFixed(2).split(".")[1] }}</text>
</view>
</view>
</view>
</view>
</view>
<view class="cart-empty">
<ns-empty text="暂无订单" :isIndex="false"
v-if="selectId == 0 && orderList.length == 0 && emptyShow"></ns-empty>
<ns-empty text="暂无结算订单" :isIndex="false"
v-if="selectId == 1 && orderList.length == 0 && emptyShow"></ns-empty>
<ns-empty text="暂无已结算订单" :isIndex="false"
v-if="selectId == 2 && orderList.length == 0 && emptyShow"></ns-empty>
<ns-empty text="暂无已退款订单" :isIndex="false"
v-if="selectId == 3 && orderList.length == 0 && emptyShow"></ns-empty>
<ns-empty text="暂无订单" :isIndex="false" v-if="selectId == 0 && orderList.length == 0 && emptyShow"></ns-empty>
<ns-empty text="暂无待结算订单" :isIndex="false" v-if="selectId == 1 && orderList.length == 0 && emptyShow"></ns-empty>
<ns-empty text="暂无结算订单" :isIndex="false" v-if="selectId == 2 && orderList.length == 0 && emptyShow"></ns-empty>
<ns-empty text="暂无已退款订单" :isIndex="false" v-if="selectId == 3 && orderList.length == 0 && emptyShow"></ns-empty>
</view>
</view>
</mescroll-uni>
@@ -96,16 +79,22 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsLogin,
MescrollUni,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
privacyPopup
// #endif
},
data() {
@@ -144,7 +133,7 @@ export default {
if (option.type != undefined) this.selectId = option.type;
},
onShow() {
setTimeout(() => {
setTimeout( () => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
@@ -155,9 +144,9 @@ export default {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
}, 1000);
},1000);
if (this.fenxiaoWords && this.fenxiaoWords.concept) this.$langConfig.title(this.fenxiaoWords.concept + '订单');
if(this.fenxiaoWords && this.fenxiaoWords.concept)this.$langConfig.title(this.fenxiaoWords.concept + '订单');
if (!this.storeToken) {
this.$nextTick(() => {
@@ -215,7 +204,7 @@ export default {
}
},
watch: {
storeToken: function (nVal, oVal) {
storeToken: function(nVal, oVal) {
if (nVal) {
this.$refs.mescroll.refresh();
}
@@ -225,5 +214,5 @@ export default {
</script>
<style lang="scss">
@import '../public/css/order.scss';
@import './public/css/order.scss';
</style>

View File

@@ -12,20 +12,15 @@
</view>
<view class="detail-body">
<view class="detail-body-box">
<view class="goods-image">
<image :src="$util.img(orderData.sku_image, { size: 'mid' })" @error="imageError()"
mode="aspectFill"></image>
</view>
<view class="goods-image"><image :src="$util.img(orderData.sku_image, { size: 'mid' })" @error="imageError()" mode="aspectFill"></image></view>
<view class="order-info">
<view class="goods-name">{{ orderData.sku_name }}</view>
<view class="goods-sub-section margin-top">
<view>
<text class="goods-price">
<text class="unit price-color"></text>
<text class="price-color font-size-toolbar">{{
parseFloat(orderData.price).toFixed(2).split(".")[0] }}</text>
<text class="unit price-color">.{{
parseFloat(orderData.price).toFixed(2).split(".")[1] }}</text>
<text class="price-color font-size-toolbar" >{{ parseFloat(orderData.price).toFixed(2).split(".")[0] }}</text>
<text class="unit price-color">.{{ parseFloat(orderData.price).toFixed(2).split(".")[1] }}</text>
</text>
</view>
<view>
@@ -66,10 +61,9 @@
<text class="price-color font-size-toolbar">
<text class="font-size-goods-tag"></text>
{{ parseFloat(orderData.commission).toFixed(2).split(".")[0] }}
<text class="font-size-goods-tag">.{{
parseFloat(orderData.commission).toFixed(2).split(".")[1] }}</text>
<text class="font-size-goods-tag">.{{ parseFloat(orderData.commission).toFixed(2).split(".")[1] }}</text>
</text>
</view>
</view>
</view>
@@ -82,10 +76,6 @@
<script>
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
},
data() {
return {
isIphoneX: false,
@@ -95,6 +85,7 @@ export default {
}
};
},
components: {},
onLoad(option) {
if (option.id) {
this.orderId = option.id;
@@ -106,7 +97,7 @@ export default {
},
mixins: [fenxiaoWords],
onShow() {
setTimeout(() => {
setTimeout( () => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
@@ -117,7 +108,7 @@ export default {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
}, 1000);
},1000);
this.isIphoneX = this.$util.uniappIsIPhoneX();
@@ -160,7 +151,7 @@ export default {
}
},
watch: {
storeToken: function (nVal, oVal) {
storeToken: function(nVal, oVal) {
if (nVal) {
this.getOrderData();
}
@@ -175,14 +166,12 @@ export default {
padding: 0 $padding;
box-sizing: border-box;
margin-top: $margin-updown;
.order-detail-box {
width: 100%;
height: 100%;
box-sizing: border-box;
background: #ffffff;
border-radius: $border-radius;
.header {
width: 100%;
padding: 30rpx;
@@ -190,14 +179,12 @@ export default {
justify-content: space-between;
align-items: center;
box-sizing: border-box;
.title {
display: inline-block;
position: relative;
line-height: 1;
}
}
.detail-body {
width: 100%;
padding: 0 30rpx 30rpx 30rpx;
@@ -207,12 +194,10 @@ export default {
width: 100%;
height: 100%;
display: flex;
.goods-image {
width: 180rpx;
height: 180rpx;
border-radius: $border-radius;
image {
width: 100%;
height: 100%;
@@ -220,7 +205,6 @@ export default {
border-radius: $border-radius;
}
}
.order-info {
width: calc(100% - 200rpx);
height: 180rpx;
@@ -229,7 +213,6 @@ export default {
display: flex;
flex-direction: column;
justify-content: space-between;
.goods-name {
display: -webkit-box;
-webkit-box-orient: vertical;
@@ -257,7 +240,6 @@ export default {
view {
flex: 1;
line-height: 1.3;
&:last-of-type {
text-align: right;
@@ -271,22 +253,18 @@ export default {
}
}
}
.detail-content {
width: 100%;
padding: 0 30rpx 30rpx 30rpx;
box-sizing: border-box;
border-bottom: 1rpx solid $color-line;
text {
font-size: $font-size-base;
}
.order-info-item .tit {
display: inline-block;
}
}
.detail-footer {
width: 100%;
height: 100rpx;
@@ -302,21 +280,17 @@ export default {
}
}
}
.commission {
margin-top: 20rpx;
.detail-content {
border: 0 !important;
}
}
.order-money-detail {
width: 100%;
padding: 0 $padding;
box-sizing: border-box;
margin-top: $margin-updown;
.order-money-detail-box {
width: 100%;
height: 100%;
@@ -324,7 +298,6 @@ export default {
box-sizing: border-box;
background: #ffffff;
border-radius: $border-radius;
.header {
width: 100%;
height: 70rpx;
@@ -333,7 +306,6 @@ export default {
display: flex;
align-items: center;
box-sizing: border-box;
.title {
padding-left: 20rpx;
display: inline-block;
@@ -341,7 +313,6 @@ export default {
line-height: 1;
font-weight: 600;
}
.title::before {
content: '';
display: block;
@@ -353,12 +324,10 @@ export default {
border-radius: 6rpx;
}
}
.money-detail-body {
width: 100%;
padding: $padding;
box-sizing: border-box;
.order-cell {
display: flex;
margin: 10rpx 0;
@@ -394,7 +363,6 @@ export default {
margin-left: 6rpx;
}
}
text {
color: $color-tip;
font-size: $font-size-tag;
@@ -403,8 +371,7 @@ export default {
}
}
}
.price-color {
.price-color{
color: var(--price-color);
}
</style>

View File

@@ -57,18 +57,8 @@
</template>
<script>
import htmlParser from '@/common/js/html-parser.js';
import htmlParser from '@/common/js/html-parser';
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
nsCopyright: () => import('@/components/ns-copyright/ns-copyright.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
},
data() {
return {
tabIndex: 0,

View File

@@ -0,0 +1,306 @@
<template>
<view class="container" :style="themeColor">
<swiper class="swiper" @change="getIndex">
<swiper-item v-for="(item, index) in poster" :key="index">
<view class="swiper-item">
<view class="poster-wrap">
<image :src="$util.img(item)" mode="widthFix" :show-menu-by-longpress="true"/>
</view>
</view>
</swiper-item>
</swiper>
<!-- #ifdef H5 -->
<view class="tips">长按识别图中二维码</view>
<!-- #endif -->
<!-- #ifdef MP -->
<view class="btn color-base-bg color-base-border" @click="save">保存海报</view>
<!-- #endif -->
<uni-popup ref="popupDialog" :custom="true" :mask-click="false">
<view class="dialog-popup">
<view class="title">提示</view>
<view class="message">您拒绝了保存图片到相册的授权请求无法保存图片到相册如需正常使用请授权之后再进行操作</view>
<view class="action-wrap">
<view @click="closeDialog">取消</view>
<view>
<button type="default" open-type="openSetting" @opensetting="closeDialog" hover-class="none">立即授权</button>
</view>
</view>
</view>
</uni-popup>
<ns-login ref="login"></ns-login>
<loading-cover ref="loadingCover"></loading-cover>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
</view>
</template>
<script>
import {
Weixin
} from 'common/js/wx-jssdk.js';
import uniPopup from '@/components/uni-popup/uni-popup.vue';
export default {
data() {
return {
poster: [],
fenxiaoInfo: {},
posterIndex: 0,
//海报模板id
templateId: ['default'],
mpShareData: null //小程序分享数据
};
},
components: {
uniPopup
},
methods: {
/**
* 获取分销海报
*/
getPoster(id) {
return new Promise((resolve, reject) => {
this.$api.sendRequest({
url: '/fenxiao/api/fenxiao/poster',
data: {
page: '/pages/index/index',
qrcode_param: JSON.stringify({}),
template_id: id
},
success: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
if (res.code >= 0) {
resolve(res.data.path);
}
},
fail: res => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
reject();
}
});
});
},
getIndex(e) {
this.posterIndex = e.detail.current;
},
save() {
// #ifdef MP
uni.downloadFile({
url: this.$util.img(this.poster[this.posterIndex]),
success: res => {
if (res.statusCode === 200) {
uni.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success: () => {
this.$util.showToast({
title: '保存成功'
});
},
fail: res => {
if (res.errMsg == 'saveImageToPhotosAlbum:fail auth deny' ||
res.errMsg == 'saveImageToPhotosAlbum:fail:auth denied') {
this.$refs.popupDialog.open();
} else {
this.$util.showToast({
title: '保存失败,请稍后重试'
});
}
}
});
} else {
this.$util.showToast({
title: '下载失败'
});
}
},
fail: res => {
this.$util.showToast({
title: '下载失败'
});
}
});
// #endif
},
getFenxiaoDetail() {
this.poster = [];
try {
this.templateId.forEach((item, index) => {
this.getPoster(item).then(resolve => {
this.poster.push(resolve);
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}).catch(reject => {
throw reject;
});
});
} catch {
this.$util.showToast({
title: '海报生成失败'
});
}
},
closeDialog() {
this.$refs.popupDialog.close();
}
},
onLoad(option) {
setTimeout( () => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
mask: true,
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
},1000);
if (option.templateId) {
this.templateId = option.templateId.split(',');
}
if (this.storeToken) {
if(option.poster){
this.poster = decodeURIComponent(option.poster).split(',')
setTimeout(() => {
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}, 500)
}else{
this.getFenxiaoDetail();
}
} else {
this.$nextTick(() => {
this.$refs.login.open('/pages_promotion/fenxiao/promote_code');
});
}
},
onShow() {
//小程序分享
// #ifdef MP-WEIXIN
this.$util.getMpShare().then(res => {
this.mpShareData = res;
});
// #endif
},
//分享给好友
onShareAppMessage() {
return this.mpShareData.appMessage;
},
//分享到朋友圈
onShareTimeline() {
return this.mpShareData.timeLine;
},
watch: {
storeToken: function(nVal, oVal) {
if (nVal) {
this.getFenxiaoDetail();
}
}
}
};
</script>
<style lang="scss">
.container {
width: 100vw;
min-height: 100vh;
background-color: #f5f5f5;
}
.poster-wrap {
padding: 40rpx 0;
width: calc(100vw - 80rpx);
margin: 0 40rpx;
line-height: 1;
image {
border-radius: 20rpx;
overflow: hidden;
width: 100%;
}
}
.swiper {
height: 1240rpx;
}
.btn {
margin: 0 80rpx;
margin-top: 30rpx;
height: 80rpx;
line-height: 80rpx;
border-radius: $border-radius;
color: #fff;
text-align: center;
}
.tips {
text-align: center;
font-size: $font-size-base;
color: #999;
font-weight: 600;
margin-top: 20rpx;
}
.dialog-popup {
width: 580rpx;
background: #fff;
box-sizing: border-box;
border-radius: 10rpx;
overflow: hidden;
height: initial;
.title {
padding: 30rpx 30rpx 0 30rpx;
text-align: center;
font-size: 32rpx;
font-weight: bold;
}
.message {
padding: 0 30rpx;
color: #666;
text-align: center;
font-size: $font-size-base;
line-height: 1.3;
margin-top: 30rpx;
}
.action-wrap {
margin-top: 50rpx;
height: 80rpx;
display: flex;
border-top: 2rpx solid #eee;
&>view {
flex: 1;
text-align: center;
line-height: 80rpx;
&:first-child {
border-right: 2rpx solid #eee;
color: #999;
}
button {
border: none;
line-height: 80rpx;
padding: 0;
margin: 0;
width: 100%;
height: 100%;
}
}
}
}
</style>

View File

@@ -0,0 +1,433 @@
<template>
<view class="container" :style="themeColor">
<mescroll-uni ref="mescroll" @getData="getData" top="0" :size="10">
<view slot="list">
<block v-if="list.length != 0">
<view class="banner" :style="{background: 'url('+ $util.img('public/uniapp/fenxiao/index/header_bg.png') +') no-repeat top left / 100% 100%'}">
<view class="info">
<view class="info-pic">
<image :src="info.headimg ? $util.img(info.headimg) : $util.getDefaultImage().head" @error="info.headimg = $util.getDefaultImage().head" mode="aspectFill"/>
</view>
<view class="member-info">
<view class="rank-info-box">
<text class="name">{{info.nickname}}</text>
</view>
<view class="withdrawal" @click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_apply')" v-if="type == 'profit'">点击提现</view>
<view class="withdrawal" @click="$util.redirectTo('/pages_promotion/fenxiao/team')" v-if="type == 'invited_num'">我的团队</view>
</view>
</view>
</view>
<view class="fenxiao-team" v-if="type == 'profit'">
<view class="fenxiao-index-other">
<view class="all-money-item">
<view class="img-wrap">
<text class="iconfont icon-fenxiao"></text>
</view>
<view class="all-money-tit-wrap">
<text class="all-money-tit">分销佣金</text>
<text class="all-money-num">{{ info.today_commission}}</text>
</view>
</view>
</view>
<view class="fenxiao-index-other">
<view class="all-money-item">
<view class="img-wrap">
<text class="iconfont icon-baixingbeng"></text>
</view>
<view class="all-money-tit-wrap">
<text class="all-money-tit">佣金排行</text>
<text class="all-money-num">您排行第{{ ranking }}</text>
</view>
</view>
</view>
</view>
<view class="fenxiao-team" v-if="type == 'invited_num'">
<view class="fenxiao-index-other">
<view class="all-money-item">
<view class="img-wrap">
<text class="iconfont icon-huodongtuiyan"></text>
</view>
<view class="all-money-tit-wrap">
<text class="all-money-tit">推广人数</text>
<text class="all-money-num">{{ info.one_child_num}}</text>
</view>
</view>
</view>
<view class="fenxiao-index-other">
<view class="all-money-item">
<view class="img-wrap">
<text class="iconfont icon-baixingbeng"></text>
</view>
<view class="all-money-tit-wrap">
<text class="all-money-tit" v-if="type == 'invited_num'">推广排行</text>
<text class="all-money-num">您排行第{{ ranking }}</text>
</view>
</view>
</view>
</view>
<view class="title-rakn-text" v-if="type == 'profit'">佣金排行</view>
<view class="title-rakn-text" v-if="type == 'invited_num'">推广排行</view>
<view class="ranking-list">
<view class="ranking-item" v-for="(item, index) in list" :key="index">
<view class="ranking price-font">{{ index + 1 }}</view>
<view class="content">
<view class="head-img">
<image :src="item.headimg ? $util.img(item.headimg) : $util.getDefaultImage().head" @error="item.headimg = $util.getDefaultImage().head" mode="aspectFill"/>
</view>
<view class="nickname">{{ item.nickname }}</view>
</view>
<view class="price-font price-style" v-if="type == 'profit'">
{{ item.total_commission|moneyFormat }}</view>
<view class="price-font price-style" v-if="type == 'invited_num'">{{ item.child_num }}
</view>
</view>
</view>
</block>
<block v-if="list.length == 0 && emptyShow">
<ns-empty text="暂无数据" :isIndex="false"></ns-empty>
</block>
</view>
</mescroll-uni>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
nsLogin,
MescrollUni,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
list: [],
emptyShow: false,
type: '',
ranking: 0,
info: {}
}
},
onLoad(data) {
this.type = data.type;
this.getRanking();
this.getFenxiaoDetail();
},
methods: {
getData(mescroll) {
this.emptyShow = false;
if (mescroll.num == 1) {
this.list = [];
}
this.$api.sendRequest({
url: '/fenxiao/api/fenxiao/rankinglist',
data: {
page_size: mescroll.size,
page: mescroll.num,
type: this.type
},
success: res => {
this.emptyShow = 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.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();
}
});
},
getRanking() {
this.$api.sendRequest({
url: '/fenxiao/api/fenxiao/ranking',
data: {
type: this.type
},
success: res => {
if (res.code >= 0) {
this.ranking = res.data;
}
}
})
},
getFenxiaoDetail() {
this.$api.sendRequest({
url: '/fenxiao/api/fenxiao/detail',
success: res => {
if (res.data) {
this.info = res.data;
}
},
});
},
}
}
</script>
<style lang="scss">
.container {
width: 100vw;
height: 100vh;
}
.banner {
width: 100%;
height: 200rpx;
// background: $base-color;
}
.info {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 50rpx 80rpx 0;
box-sizing: border-box;
.info-pic {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
border: 4rpx solid #fff;
position: relative;
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.member-info {
flex: 1;
width: 0;
margin-left: 32rpx;
display: flex;
view {
color: #fff;
}
.rank-info-box {
line-height: 1;
flex: 1;
}
.name {
font-size: 32rpx;
font-weight: 600;
color: #FFFFFF;
}
.withdrawal {
border-radius: 4px;
line-height: 23px;
margin: auto;
text-align: center;
font-size: 11px;
}
}
}
.fenxiao-team {
display: flex;
width: 100%;
margin-top: 22rpx;
.fenxiao-index-other {
margin: 0 24rpx 20rpx 24rpx;
border-radius: 16rpx;
background-color: #ffffff;
padding: 30rpx 0;
flex: 1;
&:last-child {
margin-left: 0;
}
.all-money-item {
margin: 0 30rpx;
display: flex;
font-size: $font-size-tag;
align-items: center;
.img-wrap {
display: flex;
justify-content: center;
align-items: center;
width: 70rpx;
height: 70rpx;
image {
width: 100%;
height: 100%;
}
}
.all-money-tit-wrap {
flex: 1;
margin-left: 24rpx;
display: flex;
flex-direction: column;
height: 70rpx;
.all-money-tit {
line-height: 1;
color: $color-title;
font-size: $font-size-base;
flex: 1;
}
.all-money-num {
color: $color-tip;
font-size: 24rpx;
line-height: 1;
}
}
}
}
}
.icon-wenxiao {
text-align: center;
font-size: 50rpx;
color: var(--base-color) !important;
}
.number {
font-weight: 600;
text-align: center;
}
.info-text {
font-size: 20rpx;
text-align: center;
}
.info-title {
font-size: 50rpx;
font-weight: 900;
color: #f5f5f5;
text-align: center;
}
.info-rank {
color: #f5f5f5;
margin-top: 10rpx;
}
.title-rakn-text {
text-align: center;
font-size: 30rpx;
font-weight: 900;
}
.ranking-list {
transform: translateY(-120rpx);
margin: 200rpx 24rpx;
background: #fff;
border-radius: 16rpx;
padding: 10rpx 20rpx;
margin-top: 140rpx;
.ranking-item {
display: flex;
align-items: center;
padding: 20rpx 0;
border-bottom: 2rpx solid #f5f5f5;
&:last-child {
border-bottom: 0;
}
.ranking {
width: 60rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 24rpx;
}
&:nth-child(1) .ranking {
background: rgb(249, 186, 1);
border-radius: 50%;
border: 10rpx solid rgb(254, 220, 92);
}
&:nth-child(2) .ranking {
background: rgb(172, 185, 194);
border-radius: 50%;
border: 10rpx solid rgb(215, 223, 229);
}
&:nth-child(3) .ranking {
background: rgb(211, 163, 136);
border-radius: 50%;
border: 10rpx solid rgb(235, 201, 190);
}
.content {
flex: 1;
width: 0;
padding: 0 20rpx;
display: flex;
align-items: center;
.head-img {
width: 90rpx;
height: 90rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.nickname {
color: #333;
margin: 0 20rpx;
font-size: 28rpx;
}
}
}
}
</style>

View File

@@ -72,16 +72,23 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsLogin,
MescrollUni,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
privacyPopup
// #endif
},
data() {
@@ -154,7 +161,7 @@ export default {
</script>
<style lang="scss">
@import '../public/css/order.scss';
@import './public/css/order.scss';
.goods-wraps {
align-items: center;

View File

@@ -1,431 +0,0 @@
<template>
<view class="container" :style="themeColor">
<mescroll-uni ref="mescroll" @getData="getData" top="0" :size="10">
<view slot="list">
<block v-if="list.length != 0">
<view class="banner"
:style="{ background: 'url(' + $util.img('public/uniapp/fenxiao/index/header_bg.png') + ') no-repeat top left / 100% 100%' }">
<view class="info">
<view class="info-pic">
<image :src="info.headimg ? $util.img(info.headimg) : $util.getDefaultImage().head"
@error="info.headimg = $util.getDefaultImage().head" mode="aspectFill" />
</view>
<view class="member-info">
<view class="rank-info-box">
<text class="name">{{ info.nickname }}</text>
</view>
<view class="withdrawal"
@click="$util.redirectTo('/pages_promotion/fenxiao/withdraw_apply')"
v-if="type == 'profit'">点击提现</view>
<view class="withdrawal" @click="$util.redirectTo('/pages_promotion/fenxiao/team')"
v-if="type == 'invited_num'">我的团队</view>
</view>
</view>
</view>
<view class="fenxiao-team" v-if="type == 'profit'">
<view class="fenxiao-index-other">
<view class="all-money-item">
<view class="img-wrap">
<text class="iconfont icon-fenxiao"></text>
</view>
<view class="all-money-tit-wrap">
<text class="all-money-tit">分销佣金</text>
<text class="all-money-num">{{ info.today_commission }}</text>
</view>
</view>
</view>
<view class="fenxiao-index-other">
<view class="all-money-item">
<view class="img-wrap">
<text class="iconfont icon-baixingbeng"></text>
</view>
<view class="all-money-tit-wrap">
<text class="all-money-tit">佣金排行</text>
<text class="all-money-num">您排行第{{ ranking }}</text>
</view>
</view>
</view>
</view>
<view class="fenxiao-team" v-if="type == 'invited_num'">
<view class="fenxiao-index-other">
<view class="all-money-item">
<view class="img-wrap">
<text class="iconfont icon-huodongtuiyan"></text>
</view>
<view class="all-money-tit-wrap">
<text class="all-money-tit">推广人数</text>
<text class="all-money-num">{{ info.one_child_num }}</text>
</view>
</view>
</view>
<view class="fenxiao-index-other">
<view class="all-money-item">
<view class="img-wrap">
<text class="iconfont icon-baixingbeng"></text>
</view>
<view class="all-money-tit-wrap">
<text class="all-money-tit" v-if="type == 'invited_num'">推广排行</text>
<text class="all-money-num">您排行第{{ ranking }}</text>
</view>
</view>
</view>
</view>
<view class="title-rakn-text" v-if="type == 'profit'">佣金排行</view>
<view class="title-rakn-text" v-if="type == 'invited_num'">推广排行</view>
<view class="ranking-list">
<view class="ranking-item" v-for="(item, index) in list" :key="index">
<view class="ranking price-font">{{ index + 1 }}</view>
<view class="content">
<view class="head-img">
<image :src="item.headimg ? $util.img(item.headimg) : $util.getDefaultImage().head"
@error="item.headimg = $util.getDefaultImage().head" mode="aspectFill" />
</view>
<view class="nickname">{{ item.nickname }}</view>
</view>
<view class="price-font price-style" v-if="type == 'profit'">
{{ item.total_commission | moneyFormat }}</view>
<view class="price-font price-style" v-if="type == 'invited_num'">{{ item.child_num }}
</view>
</view>
</view>
</block>
<block v-if="list.length == 0 && emptyShow">
<ns-empty text="暂无数据" :isIndex="false"></ns-empty>
</block>
</view>
</mescroll-uni>
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
},
data() {
return {
list: [],
emptyShow: false,
type: '',
ranking: 0,
info: {}
}
},
onLoad(data) {
this.type = data.type;
this.getRanking();
this.getFenxiaoDetail();
},
methods: {
getData(mescroll) {
this.emptyShow = false;
if (mescroll.num == 1) {
this.list = [];
}
this.$api.sendRequest({
url: '/fenxiao/api/fenxiao/rankinglist',
data: {
page_size: mescroll.size,
page: mescroll.num,
type: this.type
},
success: res => {
this.emptyShow = 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.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();
}
});
},
getRanking() {
this.$api.sendRequest({
url: '/fenxiao/api/fenxiao/ranking',
data: {
type: this.type
},
success: res => {
if (res.code >= 0) {
this.ranking = res.data;
}
}
})
},
getFenxiaoDetail() {
this.$api.sendRequest({
url: '/fenxiao/api/fenxiao/detail',
success: res => {
if (res.data) {
this.info = res.data;
}
},
});
},
}
}
</script>
<style lang="scss">
.container {
width: 100vw;
height: 100vh;
}
.banner {
width: 100%;
height: 200rpx;
// background: $base-color;
}
.info {
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
padding: 50rpx 80rpx 0;
box-sizing: border-box;
.info-pic {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
border: 4rpx solid #fff;
position: relative;
image {
width: 100%;
height: 100%;
border-radius: 50%;
}
}
.member-info {
flex: 1;
width: 0;
margin-left: 32rpx;
display: flex;
view {
color: #fff;
}
.rank-info-box {
line-height: 1;
flex: 1;
}
.name {
font-size: 32rpx;
font-weight: 600;
color: #FFFFFF;
}
.withdrawal {
border-radius: 4px;
line-height: 23px;
margin: auto;
text-align: center;
font-size: 11px;
}
}
}
.fenxiao-team {
display: flex;
width: 100%;
margin-top: 22rpx;
.fenxiao-index-other {
margin: 0 24rpx 20rpx 24rpx;
border-radius: 16rpx;
background-color: #ffffff;
padding: 30rpx 0;
flex: 1;
&:last-child {
margin-left: 0;
}
.all-money-item {
margin: 0 30rpx;
display: flex;
font-size: $font-size-tag;
align-items: center;
.img-wrap {
display: flex;
justify-content: center;
align-items: center;
width: 70rpx;
height: 70rpx;
image {
width: 100%;
height: 100%;
}
}
.all-money-tit-wrap {
flex: 1;
margin-left: 24rpx;
display: flex;
flex-direction: column;
height: 70rpx;
.all-money-tit {
line-height: 1;
color: $color-title;
font-size: $font-size-base;
flex: 1;
}
.all-money-num {
color: $color-tip;
font-size: 24rpx;
line-height: 1;
}
}
}
}
}
.icon-wenxiao {
text-align: center;
font-size: 50rpx;
color: var(--base-color) !important;
}
.number {
font-weight: 600;
text-align: center;
}
.info-text {
font-size: 20rpx;
text-align: center;
}
.info-title {
font-size: 50rpx;
font-weight: 900;
color: #f5f5f5;
text-align: center;
}
.info-rank {
color: #f5f5f5;
margin-top: 10rpx;
}
.title-rakn-text {
text-align: center;
font-size: 30rpx;
font-weight: 900;
}
.ranking-list {
transform: translateY(-120rpx);
margin: 200rpx 24rpx;
background: #fff;
border-radius: 16rpx;
padding: 10rpx 20rpx;
margin-top: 140rpx;
.ranking-item {
display: flex;
align-items: center;
padding: 20rpx 0;
border-bottom: 2rpx solid #f5f5f5;
&:last-child {
border-bottom: 0;
}
.ranking {
width: 60rpx;
height: 60rpx;
display: flex;
align-items: center;
justify-content: center;
box-sizing: border-box;
font-size: 24rpx;
}
&:nth-child(1) .ranking {
background: rgb(249, 186, 1);
border-radius: 50%;
border: 10rpx solid rgb(254, 220, 92);
}
&:nth-child(2) .ranking {
background: rgb(172, 185, 194);
border-radius: 50%;
border: 10rpx solid rgb(215, 223, 229);
}
&:nth-child(3) .ranking {
background: rgb(211, 163, 136);
border-radius: 50%;
border: 10rpx solid rgb(235, 201, 190);
}
.content {
flex: 1;
width: 0;
padding: 0 20rpx;
display: flex;
align-items: center;
.head-img {
width: 90rpx;
height: 90rpx;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.nickname {
color: #333;
margin: 0 20rpx;
font-size: 28rpx;
}
}
}
}
</style>

View File

@@ -83,15 +83,22 @@
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsLogin,
MescrollUni,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
privacyPopup
// #endif
},
data() {

View File

@@ -69,9 +69,6 @@
<script>
export default {
components: {
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
},
data() {
return {
withdrawInfo: {},

View File

@@ -5,20 +5,16 @@
<block v-if="withdrawList.length">
<view class="detailed-wrap">
<view class="cont">
<view class="detailed-item" v-for="(item, index) in withdrawList" :key="index"
@click="toDetail(item.id)">
<view class="detailed-item" v-for="(item, index) in withdrawList" :key="index" @click="toDetail(item.id)">
<view class="info">
<view class="event">{{ item.transfer_type == 'balance' && '余额' ||
item.transfer_type == 'alipay' && '支付宝' || item.transfer_type == 'bank' && '银行卡' ||
item.transfer_type =='wechatpay'&&'微信' }}</view>
<view class="event">{{ item.transfer_type=='balance'&&'余额' || item.transfer_type=='alipay'&&'支付宝' || item.transfer_type=='bank'&&'银行卡' || item.transfer_type=='wechatpay'&&'微信' }}</view>
<view>
<text class="time">{{ $util.timeStampTurnTime(item.create_time) }}</text>
</view>
</view>
<view class="right-wrap">
<view class="num color-base-text">{{ item.money }}</view>
<view class="status-name" :style="withdrawState[item.status].color">{{
item.status_name }}</view>
<view class="status-name" :style="withdrawState[item.status].color">{{ item.status_name }}</view>
</view>
</view>
</view>
@@ -33,19 +29,26 @@
<loading-cover ref="loadingCover"></loading-cover>
</view>
</template>
<script>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import fenxiaoWords from 'common/js/fenxiao-words.js';
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsLogin,
MescrollUni,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
privacyPopup
// #endif
},
},
data() {
return {
withdrawState: {
@@ -71,7 +74,7 @@ export default {
};
},
onShow() {
setTimeout(() => {
setTimeout( () => {
if (!this.addonIsExist.fenxiao) {
this.$util.showToast({
title: '商家未开启分销',
@@ -82,9 +85,9 @@ export default {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
}, 1000);
},1000);
if (this.fenxiaoWords && this.fenxiaoWords.withdraw) this.$langConfig.title(this.fenxiaoWords.withdraw + '明细');
if(this.fenxiaoWords && this.fenxiaoWords.withdraw)this.$langConfig.title(this.fenxiaoWords.withdraw + '明细');
if (!this.storeToken) {
this.$nextTick(() => {
@@ -170,7 +173,7 @@ export default {
display: flex;
height: 90rpx;
&>view {
& > view {
flex: 1;
text-align: left;
padding: 0 $padding;

View File

@@ -54,9 +54,6 @@
<script>
export default {
components: {
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
},
data() {
return {
id: 0,

View File

@@ -3,19 +3,19 @@
<view class="head-wrap">
<!-- 搜索区域 -->
<view class="search-wrap uni-flex uni-row" style="margin-bottom: 20rpx;">
<!-- <view class="flex-item input-wrap">
<!-- <view class="flex-item input-wrap">
<input class="uni-input" maxlength="50" v-model="keyword" @confirm="search()" placeholder="请输入您要搜索的商品" />
<text class="iconfont icon-sousuo3" @click.stop="search()"></text>
</view>
<view class="iconfont" :class="{ 'icon-apps': isList, 'icon-list': !isList }" @click="changeListStyle()"></view> -->
<view style="width: 100rpx;height: 100rpx;">
<image :src="$util.img(merch.merch_image)" mode="widthFix" style="width: 100rpx;height: 100rpx;" />
</view>
<view style="margin-left: 20rpx;padding-top: 22rpx;">
<view style="line-height: 1;font-size: 32rpx;font-weight: 600;">{{ merch.merch_name }}</view>
<view style="line-height: 1;font-size: 32rpx;font-weight: 600;">{{merch.merch_name}}</view>
<view style="color:rgb(255 202 40)">
<text class="icox icox-xing"></text>
<text class="icox icox-xing"></text>
@@ -24,13 +24,12 @@
<text class="icox icox-xing"></text>
</view>
</view>
</view>
<!-- 排序 -->
<view class="sort-wrap">
<view class="comprehensive-wrap" :class="{ 'color-base-text': orderType === '' }"
@click="sortTabClick('')">
<view class="comprehensive-wrap" :class="{ 'color-base-text': orderType === '' }" @click="sortTabClick('')">
<text :class="{ 'color-base-text': orderType === '' }">综合</text>
</view>
@@ -40,16 +39,12 @@
<view class="price-wrap" @click="sortTabClick('discount_price')">
<text :class="{ 'color-base-text': orderType === 'discount_price' }">价格</text>
<view class="iconfont-wrap">
<view class="iconfont icon-iconangledown-copy asc"
:class="{ 'color-base-text': priceOrder === 'asc' && orderType === 'discount_price' }">
</view>
<view class="iconfont icon-iconangledown desc"
:class="{ 'color-base-text': priceOrder === 'desc' && orderType === 'discount_price' }">
</view>
<view class="iconfont icon-iconangledown-copy asc" :class="{ 'color-base-text': priceOrder === 'asc' && orderType === 'discount_price' }"></view>
<view class="iconfont icon-iconangledown desc" :class="{ 'color-base-text': priceOrder === 'desc' && orderType === 'discount_price' }"></view>
</view>
</view>
<!-- <view :class="{ 'color-base-text': orderType === 'screen' }" class="screen-wrap">
<!-- <view :class="{ 'color-base-text': orderType === 'screen' }" class="screen-wrap">
<text @click="sortTabClick('screen')">筛选</text>
<view @click="sortTabClick('screen')" class="iconfont-wrap">
<view class="iconfont icon-shaixuan color-tip"></view>
@@ -61,20 +56,17 @@
<mescroll-uni top="240" ref="mescroll" @getData="getGoodsList">
<block slot="list">
<view class="goods-list single-column" :class="{ show: isList }">
<view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="index"
@click="toDetail(item)">
<view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="index" @click="toDetail(item)">
<view class="goods-img">
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)"></image>
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}
</view>
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}</view>
<view class="sell-out" v-if="item.stock <= 0">
<text class="iconfont icon-shuqing"></text>
</view>
</view>
<view class="info-wrap">
<view class="name-wrap">
<view class="goods-name"
:class="[{ 'using-hidden': config.nameLineMode == 'single' }, { 'multi-hidden': config.nameLineMode == 'multiple' }]">
<view class="goods-name" :class="[{ 'using-hidden': config.nameLineMode == 'single' }, { 'multi-hidden': config.nameLineMode == 'multiple' }]">
{{ isEnEnv ? item.en_goods_name : item.goods_name }}
</view>
</view>
@@ -82,19 +74,15 @@
<view class="lineheight-clear">
<view class="discount-price" v-if="item.isinformation == 0">
<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>
<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="discount-price" v-else>
<text class="price price-style large">{{ $lang('Make') ? $lang('Make') : '询底价'
}}</text>
<text class="price price-style large">{{ $lang('Make') ? $lang('Make') : '询底价' }}</text>
</view>
<view class="member-price-tag"
v-if="item.member_price && item.member_price == showPrice(item)">
<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"></image>
</view>
<view class="member-price-tag" v-else-if="item.promotion_type == 1">
@@ -107,35 +95,34 @@
<text>{{ showMarketPrice(item) }}</text>
</view>
<view class="block-wrap">
<view class="sale color-tip" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit
? item.unit : '' }}</view>
<view class="sale color-tip" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit ? item.unit : '' }}</view>
</view>
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
<!-- 购物车图标 -->
<view v-if="config.style == 'icon-cart'" :style="{
color: config.theme == 'diy' ? config.textColor : '',
borderColor: config.theme == 'diy' ? config.textColor : ''
}" class="cart shopping-cart-btn iconfont icon-gouwuche click-wrap" :id="'goods-' + item.id"
color: config.theme == 'diy' ? config.textColor : '',
borderColor: config.theme == 'diy' ? config.textColor : ''
}" class="cart shopping-cart-btn iconfont icon-gouwuche click-wrap" :id="'goods-' + item.id"
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
<view class="click-event"></view>
</view>
<!--加号图标 -->
<view v-else-if="config.style == 'icon-add'" :style="{
color: config.theme == 'diy' ? config.textColor : '',
borderColor: config.theme == 'diy' ? config.textColor : ''
}" class="cart plus-sign-btn iconfont icon-add1 click-wrap" :id="'goods-' + item.id"
color: config.theme == 'diy' ? config.textColor : '',
borderColor: config.theme == 'diy' ? config.textColor : ''
}" class="cart plus-sign-btn iconfont icon-add1 click-wrap" :id="'goods-' + item.id"
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
<view class="click-event"></view>
</view>
<!-- 按钮 -->
<view v-else-if="config.style == 'button'" :style="{
backgroundColor: config.theme == 'diy' ? config.bgColor : '',
color: config.theme == 'diy' ? config.textColor : '',
fontWeight: config.theme == 'diy' ? (config.fontWeight ? 'bold' : 'normal') : '',
padding: config.theme == 'diy' ? '12rpx ' + config.padding * 2 + 'rpx' : ''
}" class="cart buy-btn click-wrap" :id="'goods-' + item.id"
backgroundColor: config.theme == 'diy' ? config.bgColor : '',
color: config.theme == 'diy' ? config.textColor : '',
fontWeight: config.theme == 'diy' ? (config.fontWeight ? 'bold' : 'normal') : '',
padding: config.theme == 'diy' ? '12rpx ' + config.padding * 2 + 'rpx' : ''
}" class="cart buy-btn click-wrap" :id="'goods-' + item.id"
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
{{ config.text }}
<view class="click-event"></view>
@@ -143,12 +130,11 @@
<!--自定义图标 -->
<view v-else-if="config.style == 'icon-diy'" :style="{
color: config.theme == 'diy' ? config.textColor : ''
}" class="icon-diy click-wrap" :id="'goods-' + item.id"
color: config.theme == 'diy' ? config.textColor : ''
}" class="icon-diy click-wrap" :id="'goods-' + item.id"
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
<view class="click-event"></view>
<diy-icon :icon="config.iconDiy.icon"
:value="config.iconDiy.style ? config.iconDiy.style : null"></diy-icon>
<diy-icon :icon="config.iconDiy.icon" :value="config.iconDiy.style ? config.iconDiy.style : null"></diy-icon>
</view>
</view>
</view>
@@ -157,36 +143,29 @@
</view>
<view class="goods-list double-column" :class="{ show: !isList }">
<view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="index"
@click="toDetail(item)"
:style="{ left: listPosition[index] ? listPosition[index].left : '', top: listPosition[index] ? listPosition[index].top : '' }">
@click="toDetail(item)" :style="{ left: listPosition[index] ? listPosition[index].left : '', top: listPosition[index] ? listPosition[index].top : '' }">
<view class="goods-img">
<image :src="goodsImg(item.goods_image)" mode="widthFix" @error="imgError(index)"></image>
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}
</view>
<view class="color-base-bg goods-tag" v-if="goodsTag(item) != ''">{{ goodsTag(item) }}</view>
<view class="sell-out" v-if="item.stock <= 0">
<text class="iconfont icon-shuqing"></text>
</view>
</view>
<view class="info-wrap">
<view class="goods-name"
:class="[{ 'using-hidden': config.nameLineMode == 'single' }, { 'multi-hidden': config.nameLineMode == 'multiple' }]">
<view class="goods-name" :class="[{ 'using-hidden': config.nameLineMode == 'single' }, { 'multi-hidden': config.nameLineMode == 'multiple' }]">
{{ isEnEnv ? item.en_goods_name : item.goods_name }}
</view>
<view class="lineheight-clear">
<view class="discount-price" v-if="item.isinformation == 0">
<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>
<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="discount-price" v-else>
<text class="price price-style large">{{ $lang('Make') ? $lang('Make') : '询底价'
}}</text>
<text class="price price-style large">{{ $lang('Make') ? $lang('Make') : '询底价' }}</text>
</view>
<view class="member-price-tag"
v-if="item.member_price && item.member_price == showPrice(item)">
<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"></image>
</view>
<view class="member-price-tag" v-else-if="item.promotion_type == 1">
@@ -197,50 +176,48 @@
<text>{{ showMarketPrice(item) }}</text>
</view>
</view>
<view class="pro-info" v-if="item.isinformation == 0">
<view class="block-wrap">
<view class="sale color-tip" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit
? item.unit : '' }}</view>
<view class="pro-info" v-if="item.isinformation == 0">
<view class="block-wrap" >
<view class="sale color-tip" v-if="item.sale_show">已售{{ item.sale_num }}{{ item.unit ? item.unit : '' }}</view>
</view>
<view class="cart-action-wrap" v-if="config.control && item.is_virtual == 0">
<!-- 购物车图标 -->
<view v-if="config.style == 'icon-cart'" :style="{
color: config.theme == 'diy' ? config.textColor : '',
borderColor: config.theme == 'diy' ? config.textColor : ''
}" class="cart shopping-cart-btn iconfont icon-gouwuche click-wrap" :id="'goods-' + item.id"
color: config.theme == 'diy' ? config.textColor : '',
borderColor: config.theme == 'diy' ? config.textColor : ''
}" class="cart shopping-cart-btn iconfont icon-gouwuche click-wrap" :id="'goods-' + item.id"
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
<view class="click-event"></view>
</view>
<!--加号图标 -->
<view v-else-if="config.style == 'icon-add'" :style="{
color: config.theme == 'diy' ? config.textColor : '',
borderColor: config.theme == 'diy' ? config.textColor : ''
}" class="cart plus-sign-btn iconfont icon-add1 click-wrap" :id="'goods-' + item.id"
color: config.theme == 'diy' ? config.textColor : '',
borderColor: config.theme == 'diy' ? config.textColor : ''
}" class="cart plus-sign-btn iconfont icon-add1 click-wrap" :id="'goods-' + item.id"
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
<view class="click-event"></view>
</view>
<!-- 按钮 -->
<view v-else-if="config.style == 'button'" :style="{
backgroundColor: config.theme == 'diy' ? config.bgColor : '',
color: config.theme == 'diy' ? config.textColor : '',
fontWeight: config.theme == 'diy' ? (config.fontWeight ? 'bold' : 'normal') : '',
padding: config.theme == 'diy' ? '12rpx ' + config.padding * 2 + 'rpx' : ''
}" class="cart buy-btn click-wrap" :id="'goods-' + item.id"
backgroundColor: config.theme == 'diy' ? config.bgColor : '',
color: config.theme == 'diy' ? config.textColor : '',
fontWeight: config.theme == 'diy' ? (config.fontWeight ? 'bold' : 'normal') : '',
padding: config.theme == 'diy' ? '12rpx ' + config.padding * 2 + 'rpx' : ''
}" class="cart buy-btn click-wrap" :id="'goods-' + item.id"
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
{{ config.text }}
<view class="click-event"></view>
</view>
<!--自定义图标 -->
<view v-else-if="config.style == 'icon-diy'" :style="{
color: config.theme == 'diy' ? config.textColor : ''
}" class="icon-diy click-wrap" :id="'goods-' + item.id"
color: config.theme == 'diy' ? config.textColor : ''
}" class="icon-diy click-wrap" :id="'goods-' + item.id"
@click.stop="$refs.goodsSkuIndex.addCart(config.cartEvent, item, $event)">
<view class="click-event"></view>
<diy-icon :icon="config.iconDiy.icon"
:value="config.iconDiy.style ? config.iconDiy.style : null"></diy-icon>
<diy-icon :icon="config.iconDiy.icon" :value="config.iconDiy.style ? config.iconDiy.style : null"></diy-icon>
</view>
</view>
</view>
@@ -258,7 +235,7 @@
<view class="title color-tip">筛选</view>
<scroll-view scroll-y>
<!-- 包邮 -->
<!-- <view class="item-wrap">
<!-- <view class="item-wrap">
<view class="label"><text>是否包邮</text></view>
<view class="list">
<uni-tag :inverted="true" text="包邮" :type="isFreeShipping ? 'primary' : 'default'" @click="isFreeShipping = !isFreeShipping" />
@@ -266,7 +243,7 @@
</view> -->
<!-- 价格筛选项 -->
<!-- <view class="item-wrap">
<!-- <view class="item-wrap">
<view class="label"><text>价格区间()</text></view>
<view class="price-wrap">
<input class="uni-input" type="digit" v-model="minPrice" placeholder="最低价" />
@@ -276,7 +253,7 @@
</view> -->
<!-- 品牌筛选项 -->
<!-- <view class="item-wrap" v-if="brandList.length > 0">
<!-- <view class="item-wrap" v-if="brandList.length > 0">
<view class="label"><text>品牌</text></view>
<view class="list">
<view v-for="(item, index) in brandList" :key="index">
@@ -292,11 +269,8 @@
<view @click="selectedCategory('')" class="list-wrap">
<text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">全部</text>
</view>
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList"
:key="index" class="list-wrap">
<text
:class="{ selected: item.category_id == categoryId, 'color-base-text': item.category_id == categoryId }">{{
item.category_name }}</text>
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList" :key="index" class="list-wrap">
<text :class="{ selected: item.category_id == categoryId, 'color-base-text': item.category_id == categoryId }">{{ item.category_name }}</text>
</view>
</view>
</view>
@@ -316,43 +290,47 @@
</template>
<script>
import list from './public/js/list.js';
import uniDrawer from '@/components/uni-drawer/uni-drawer.vue';
import uniTag from '@/components/uni-tag/uni-tag.vue';
import nsGoodsSkuIndex from '@/components/ns-goods-sku/ns-goods-sku-index.vue';
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import list from './public/js/list.js';
export default {
components: {
uniDrawer: () => import('@/components/uni-drawer/uni-drawer.vue'),
uniTag: () => import('@/components/uni-tag/uni-tag.vue'),
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
nsGoodsSkuIndex: () => import('@/components/ns-goods-sku/ns-goods-sku-index.vue'),
uniNumberBox: () => import('@/components/uni-number-box/uni-number-box.vue'),
nsGoodsSku: () => import('@/components/ns-goods-sku/ns-goods-sku.vue'),
toTop: () => import('@/components/toTop/toTop.vue'),
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsPayment: () => import('@/components/payment/payment.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
},
data() {
return {};
},
mixins: [list]
};
export default {
components: {
uniDrawer,
uniTag,
nsGoodsSkuIndex,
MescrollUni,
nsLogin,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {};
},
mixins: [list]
};
</script>
<style lang="scss">
@import './public/css/list.scss';
@import './public/css/list.scss';
</style>
<style lang="scss" scoped>
/deep/ .uni-tag--primary.uni-tag--inverted {
background-color: #f5f5f5 !important;
}
<style scoped>
>>>.uni-tag--primary.uni-tag--inverted {
background-color: #f5f5f5 !important;
}
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
/deep/ .sku-layer .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}
</style>

View File

@@ -61,10 +61,7 @@
<script>
export default {
components: {
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
},
components: {},
data() {
return {
scrollTop: 0,

View File

@@ -1,924 +0,0 @@
<template>
<view class="content" :style="themeColor">
<view class="head-wrap">
<!-- 搜索区域 -->
<view class="search-wrap uni-flex uni-row">
<view class="flex-item input-wrap" @click.stop="search()" @tap.stop="search()">
<input class="uni-input" maxlength="50" v-model="keyword" confirm-type="search" @confirm="search()"
@click.stop="search()" @tap.stop="search()"
:placeholder="isEnEnv ? 'Please enter product keywords' : '请输入商品关键词'" />
<text class="iconfont icon-sousuo3" @click.stop="search()" @tap.stop="search()"></text>
</view>
</view>
<!-- 排序 -->
<view class="sort-wrap">
<view class="comprehensive-wrap" :class="{ 'color-base-text': order === '' }" @click="sortTabClick('')">
<text :class="{ 'color-base-text': order === '' }">{{ isEnEnv ? 'Comprehensive' : '综合' }}</text>
</view>
<view class="price-wrap" @click="sortTabClick('point')">
<text :class="{ 'color-base-text': order === 'point' }">{{ isEnEnv ? 'Points' : '积分' }}</text>
<view class="iconfont-wrap">
<view class="iconfont icon-shangsanjiao-copy"
:class="{ 'color-base-text': priceOrder === 'asc' && order === 'point' }"></view>
<view class="iconfont icon-sanjiao"
:class="{ 'color-base-text': priceOrder === 'desc' && order === 'point' }"></view>
</view>
</view>
<view class="price-wrap" @click="sortTabClick('create_time')">
<text :class="{ 'color-base-text': order === 'create_time' }">{{ isEnEnv ? 'New Arrival' : '上新时间'
}}</text>
<view class="iconfont-wrap">
<view class="iconfont icon-shangsanjiao-copy"
:class="{ 'color-base-text': priceOrder === 'asc' && order === 'create_time' }"></view>
<view class="iconfont icon-sanjiao"
:class="{ 'color-base-text': priceOrder === 'desc' && order === 'create_time' }"></view>
</view>
</view>
<view :class="{ 'color-base-text': order === 'screen' }" class="screen-wrap">
<text @click="sortTabClick('screen')">{{ isEnEnv ? 'Filter' : '筛选' }}</text>
<view @click="sortTabClick('screen')" class="iconfont-wrap">
<view class="iconfont icon-shaixuan color-tip"></view>
</view>
</view>
</view>
</view>
<mescroll-uni top="180" @getData="getData" ref="mescroll" :size="10">
<block slot="list">
<view class="list-wrap">
<view class="goods-list double-column" v-if="goodsList.length">
<view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="index">
<view class="goods-img" @click="toDetail(item)">
<image :src="goodsImg(item.image)" mode="widthFix" @error="imgError(index)"></image>
</view>
<view class="info-wrap">
<view class="name-wrap">
<view class="goods-name" @click="toDetail(item)">{{ isEnEnv ? item.en_goods_name :
item.goods_name }}</view>
</view>
<view class="lineheight-clear">
<view class="discount-price">
<text class="unit ">{{ item.point }}</text>
<text class="unit font-size-tag">{{ isEnEnv ? 'Points' : '积分' }}</text>
<block v-if="item.price > 0 && item.pay_type > 0">
<text class="unit font-size-tag">+</text>
<text class="unit font-size-tag">{{ $lang('common.currencySymbol')
}}</text>
<text class="price font-size-toolbar">{{
parseFloat(item.price).toFixed(2).split(".")[0] }}</text>
<text class="unit font-size-tag">.{{
parseFloat(item.price).toFixed(2).split(".")[1] }}</text>
</block>
</view>
</view>
<view class="pro-info" v-if="item.stock_show">
<view class="font-size-activity-tag color-tip">{{ isEnEnv ? 'Stock ' : '库存' }}{{
item.stock }}</view>
<view class="sale font-size-activity-tag color-tip" @click="toDetail(item)">
<!-- <button type="primary" size="mini">立即兑换</button> -->
</view>
</view>
</view>
</view>
</view>
<view class="empty" v-if="goodsList.length == 0">
<ns-empty :isIndex="false"
:text="isEnEnv ? 'No point products available' : '暂无积分商品'"></ns-empty>
</view>
</view>
</block>
</mescroll-uni>
<!-- 筛选弹出框 -->
<uni-drawer :visible="showScreen" mode="right" @close="showScreen = false" class="screen-wrap">
<view class="title color-tip">{{ isEnEnv ? 'Filter' : '筛选' }}</view>
<scroll-view scroll-y>
<!-- 价格筛选项 -->
<view class="item-wrap">
<view class="label"><text>{{ isEnEnv ? 'Point Range' : '积分区间' }}</text></view>
<view class="price-wrap">
<input class="uni-input" type="digit" v-model="minPoint"
:placeholder="isEnEnv ? 'Min' : '最低'" />
<view class="h-line"></view>
<input class="uni-input" type="digit" v-model="maxPoint"
:placeholder="isEnEnv ? 'Max' : '最高'" />
</view>
</view>
<!-- 分类筛选项 -->
<view class="category-list-wrap">
<text class="first">{{ isEnEnv ? 'All Categories' : '全部分类' }}</text>
<view class="class-box">
<view @click="selectedCategory('')" class="list-wrap"><text
:class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ isEnEnv ? 'All' :
'全部' }}</text></view>
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList"
:key="index" class="list-wrap">
<text
:class="{ selected: item.category_id == categoryId, 'color-base-text': item.category_id == categoryId }">{{
item.category_name }}</text>
</view>
</view>
</view>
</scroll-view>
<view class="footer" :class="{ 'safe-area': isIphoneX }">
<button type="default" class="footer-box" @click="resetData">{{ isEnEnv ? 'Reset' : '重置' }}</button>
<button type="primary" class="footer-box1" @click="screenData">{{ isEnEnv ? 'Confirm' : '确定' }}</button>
</view>
</uni-drawer>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
</view>
</template>
<script>
export default {
components: {
uniDrawer: () => import('@/components/uni-drawer/uni-drawer.vue'),
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
nsSelectTime: () => import('@/components/ns-select-time/ns-select-time.vue'),
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsPayment: () => import('@/components/payment/payment.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
},
data() {
return {
listStyle: '',
priceOrder: 'desc',
categoryList: [], //排序类型
goodsList: [],
order: '',
sort: 'desc',
showScreen: false,
keyword: '',
categoryId: 0,
minPoint: '',
maxPoint: '',
isFreeShipping: false, //是否免邮
isIphoneX: false,
coupon: 0,
emptyShow: false,
isList: true, //列表样式
mescroll: null,
isLogin: false,
couponList: [],
hongbaoList: [],
point: 0,
};
},
onLoad(options) {
this.categoryId = options.category_id || 0;
this.keyword = options.keyword || '';
this.isIphoneX = this.$util.uniappIsIPhoneX();
this.coupon = options.coupon || 0;
this.loadCategoryList(this.categoryId);
},
methods: {
//获取积分商品详情
getData(mescroll) {
this.$api.sendRequest({
url: '/pointexchange/api/goods/page',
data: {
page_size: mescroll.size,
page: mescroll.num,
type: 1,
keyword: this.keyword,
category_id: this.categoryId,
min_point: this.minPoint,
max_point: this.maxPoint,
is_free_shipping: (this.isFreeShipping ? 1 : 0),
order: this.order,
sort: this.sort,
coupon: this.coupon
},
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.goodsList = []; //如果是第一页需手动制空列表
this.goodsList = this.goodsList.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
//联网失败的回调
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
//加载分类
loadCategoryList(fid, sid) {
this.$api.sendRequest({
url: '/api/goodscategory/tree',
data: {},
success: res => {
if (res.data != null) this.categoryList = res.data;
}
});
},
goodsImg(imgStr) {
let imgs = imgStr.split(',');
return imgs[0] ? this.$util.img(imgs[0], {
size: 'mid'
}) : this.$util.getDefaultImage().goods;
},
imgError(index) {
this.goodsList[index].goods_image = this.$util.getDefaultImage().goods;
},
//跳转至详情页面
toDetail(item) {
this.$util.redirectTo('/pages_promotion/point/detail', {
id: item.id
});
},
search() {
this.emptyShow = false;
this.goodsList = [];
this.$refs.mescroll.refresh();
},
//筛选点击
sortTabClick(tag) {
if (tag == 'point') {
this.order = 'point';
this.sort = 'desc';
} else if (tag == 'create_time') {
this.order = 'create_time';
this.sort = 'desc';
} else if (tag == 'screen') {
//筛选
this.showScreen = true;
return;
} else {
this.order = '';
this.sort = '';
}
this.order = tag;
if (tag === 'create_time') {
this.priceOrder = this.priceOrder === 'asc' ? 'desc' : 'asc';
this.sort = this.priceOrder;
} else if (tag === 'point') {
this.priceOrder = this.priceOrder === 'asc' ? 'desc' : 'asc';
this.sort = this.priceOrder;
}
this.emptyShow = false;
this.goodsList = [];
this.$refs.mescroll.refresh();
},
selectedCategory(categoryId) {
this.categoryId = categoryId;
},
screenData() {
if (this.minPoint != '' || this.maxPoint != '') {
// if (!Number(this.minPoint) && this.minPoint) {
// this.$util.showToast({
// title: '请输入最低价'
// });
// return;
// }
if (!Number(this.maxPoint) && this.maxPoint) {
this.$util.showToast({
title: this.isEnEnv ? 'Please enter the maximum price' : '请输入最高价'
});
return;
}
if (Number(this.minPoint) < 0 || Number(this.maxPoint) < 0) {
this.$util.showToast({
title: this.isEnEnv ? 'Filter price cannot be less than 0' : '筛选价格不能小于0'
});
return;
}
if (this.minPoint != '' && Number(this.minPoint) > Number(this.maxPoint) && this.maxPoint) {
this.$util.showToast({
title: this.isEnEnv ? 'Minimum price cannot be greater than maximum price' : '最低价不能大于最高价'
});
return;
}
if (this.maxPoint != '' && Number(this.maxPoint) < Number(this.minPoint)) {
this.$util.showToast({
title: this.isEnEnv ? 'Maximum price cannot be less than minimum price' : '最高价不能小于最低价'
});
return;
}
}
this.emptyShow = false;
this.goodsList = [];
this.$refs.mescroll.refresh();
this.showScreen = false;
},
//重置数据
resetData() {
this.showScreen = false;
this.categoryId = 0
this.minPoint = ''
this.maxPoint = ''
},
},
};
</script>
<style lang="scss">
.head-wrap {
background: #fff;
position: fixed;
width: 100%;
left: 0;
z-index: 1;
.search-wrap {
flex: 0.5;
padding: 30rpx 30rpx 0;
font-size: $font-size-tag;
display: flex;
align-items: center;
.input-wrap {
flex: 1;
display: flex;
justify-content: space-between;
align-items: center;
background: $color-bg;
height: 70rpx;
padding-left: 10rpx;
border-radius: 70rpx;
input {
width: 90%;
background: $color-bg;
font-size: $font-size-tag;
height: 50rpx;
padding: 10rpx 25rpx 10rpx 40rpx;
line-height: 50rpx;
border-radius: 40rpx;
}
text {
font-size: $font-size-toolbar;
color: $color-tip;
width: 80rpx;
text-align: center;
margin-right: 20rpx;
}
}
.category-wrap,
.list-style {
display: flex;
justify-content: center;
align-items: center;
.iconfont {
font-size: 50rpx;
color: $color-tip;
}
text {
display: block;
margin-top: 60rpx;
}
}
}
.sort-wrap {
display: flex;
padding: 10rpx 20rpx 10rpx 0;
>view {
flex: 1;
text-align: center;
font-size: $font-size-base;
height: 60rpx;
line-height: 60rpx;
}
.comprehensive-wrap {
display: flex;
justify-content: center;
align-items: center;
.iconfont-wrap {
display: inline-block;
margin-left: 10rpx;
width: 40rpx;
.iconfont {
font-size: $font-size-toolbar;
line-height: 1;
margin-bottom: 5rpx;
}
}
}
.price-wrap {
display: flex;
justify-content: center;
align-items: center;
.iconfont-wrap {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 40rpx;
.iconfont {
float: left;
font-size: 24rpx;
line-height: 1;
height: 20rpx;
color: #909399;
}
}
}
.screen-wrap {
display: flex;
justify-content: center;
align-items: center;
.iconfont-wrap {
display: inline-block;
margin-left: 10rpx;
width: 40rpx;
.iconfont {
font-size: $font-size-toolbar;
line-height: 1;
}
}
}
}
}
.category-list-wrap {
height: 100%;
.class-box {
display: flex;
flex-wrap: wrap;
padding: 0 $padding;
view {
width: calc((100% - 60rpx) / 3);
font-size: $font-size-goods-tag;
margin-right: 20rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
margin-bottom: 12rpx;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background: rgba(245, 245, 245, 1);
border-radius: 5rpx;
&:nth-of-type(3n) {
margin-right: 0;
}
}
}
.first {
font-size: $font-size-tag;
display: block;
// background: $page-color-base;
padding: 20rpx;
}
.second {
border-bottom: 2rpx solid $color-line;
padding: 20rpx;
display: block;
font-size: $font-size-tag;
}
.third {
padding: 0 20rpx 20rpx;
overflow: hidden;
font-size: $font-size-tag;
>view {
display: inline-block;
margin-right: 20rpx;
margin-top: 20rpx;
}
.uni-tag {
padding: 0 20rpx;
}
}
}
.screen-wrap {
.title {
font-size: $font-size-tag;
padding: $padding;
background: #f6f4f5;
}
scroll-view {
height: 85%;
.item-wrap {
border-bottom: 1px solid #f0f0f0;
.label {
font-size: $font-size-tag;
padding: $padding;
view {
display: inline-block;
font-size: 60rpx;
height: 40rpx;
vertical-align: middle;
line-height: 40rpx;
}
}
.list {
margin: $margin-updown $margin-both;
overflow: hidden;
>view {
display: inline-block;
margin-right: 25rpx;
margin-bottom: 25rpx;
}
.uni-tag {
padding: 0 $padding;
font-size: $font-size-goods-tag;
background: #f5f5f5;
height: 52rpx;
line-height: 52rpx;
border: 0;
}
}
.price-wrap {
display: flex;
justify-content: center;
align-items: center;
padding: $padding;
input {
flex: 1;
background: #f5f5f5;
height: 52rpx;
width: 182rpx;
line-height: 50rpx;
font-size: $font-size-goods-tag;
border-radius: 50rpx;
text-align: center;
&:first-child {
margin-right: 10rpx;
}
&:last-child {
margin-left: 10rpx;
}
}
}
}
}
.footer {
height: 90rpx;
display: flex;
justify-content: center;
align-items: flex-start;
//position: absolute;
bottom: 0;
width: 100%;
.footer-box {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
margin: 0;
width: 40%;
}
.footer-box1 {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
margin: 0;
width: 40%;
}
}
}
.safe-area {
bottom: 68rpx !important;
}
.empty {
margin-top: 100rpx;
}
.buy-num {
font-size: $font-size-activity-tag;
}
.icon {
width: 34rpx;
height: 30rpx;
}
.list-style-new {
display: flex;
align-items: center;
.line {
width: 4rpx;
height: 28rpx;
background-color: rgba(227, 227, 227, 1);
margin-right: 60rpx;
}
}
.h-line {
width: 37rpx;
height: 2rpx;
background-color: $color-tip;
}
.lineheight-clear {
line-height: 1 !important;
}
// 商品列表单列样式
.goods-list.single-column {
.goods-item {
padding: 26rpx;
background: #fff;
margin: $margin-updown $margin-both;
border-radius: $border-radius;
display: flex;
position: relative;
.goods-img {
width: 200rpx;
height: 200rpx;
overflow: hidden;
border-radius: $border-radius;
margin-right: 20rpx;
image {
width: 100%;
height: 100%;
}
}
.goods-tag {
color: #fff;
line-height: 1;
padding: 8rpx 12rpx;
position: absolute;
border-top-left-radius: $border-radius;
border-bottom-right-radius: $border-radius;
top: 26rpx;
left: 26rpx;
font-size: $font-size-goods-tag;
}
.goods-tag-img {
position: absolute;
border-top-left-radius: $border-radius;
width: 80rpx;
height: 80rpx;
top: 26rpx;
left: 26rpx;
z-index: 5;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.info-wrap {
flex: 1;
display: flex;
flex-direction: column;
}
.name-wrap {
flex: 1;
}
.goods-name {
font-size: $font-size-base;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
height: 68rpx;
}
.introduction {
line-height: 1;
margin-top: 10rpx;
}
.discount-price {
display: inline-block;
font-weight: bold;
line-height: 1;
margin-top: 16rpx;
color: var(--price-color);
.unit {
margin-right: 6rpx;
}
}
.pro-info {
display: flex;
margin-top: 16rpx;
.delete-price {
text-decoration: line-through;
flex: 1;
.unit {
margin-right: 6rpx;
}
}
&>view {
line-height: 1;
&:nth-child(2) {
text-align: right;
}
}
}
.member-price-tag {
display: inline-block;
width: 60rpx;
line-height: 1;
margin-left: 6rpx;
image {
width: 100%;
}
}
}
}
// 商品列表双列样式
.goods-list.double-column {
display: flex;
flex-wrap: wrap;
margin: 0 $margin-both;
padding-top: $margin-updown;
.goods-item {
flex: 1;
position: relative;
background-color: #fff;
flex-basis: 48%;
max-width: calc((100% - 30rpx) / 2);
margin: 0 $margin-both $margin-updown 0;
border-radius: $border-radius;
&:nth-child(2n) {
margin-right: 0;
}
.goods-img {
position: relative;
overflow: hidden;
padding-top: 100%;
border-top-left-radius: $border-radius;
border-top-right-radius: $border-radius;
image {
width: 100%;
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
}
}
.goods-tag {
color: #fff;
line-height: 1;
padding: 8rpx 16rpx;
position: absolute;
border-bottom-right-radius: $border-radius;
top: 0;
left: 0;
font-size: $font-size-goods-tag;
}
.goods-tag-img {
position: absolute;
border-top-left-radius: $border-radius;
width: 80rpx;
height: 80rpx;
top: 0;
left: 0;
z-index: 5;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.info-wrap {
padding: 0 26rpx 26rpx 26rpx;
}
.goods-name {
font-size: $font-size-base;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: 20rpx;
height: 68rpx;
}
.discount-price {
display: inline-block;
font-weight: bold;
line-height: 1;
margin-top: 16rpx;
color: var(--price-color);
.unit {
margin-right: 6rpx;
}
}
.pro-info {
display: flex;
margin-top: 16rpx;
.delete-price {
text-decoration: line-through;
flex: 1;
.unit {
margin-right: 6rpx;
}
}
&>view {
line-height: 1;
&:nth-child(2) {
text-align: right;
}
}
}
.member-price-tag {
display: inline-block;
width: 60rpx;
line-height: 1;
margin-left: 6rpx;
image {
width: 100%;
}
}
}
}
</style>
<style lang="scss" scoped>
/deep/ .uni-tag--primary.uni-tag--inverted {
background-color: #f5f5f5 !important;
}
</style>

View File

@@ -1,617 +0,0 @@
<template>
<view class="conteiner" :style="themeColor">
<!-- #ifdef MP-WEIXIN -->
<view class="point-navbar"
:style="{ 'padding-top': menuButtonBounding.top + 'px', height: menuButtonBounding.height + 'px' }">
<view class="nav-wrap" :style="{ width: menuButtonBounding.left + 'px' }">
<view class="back" @click="back"
:style="{ width: menuButtonBounding.height + 'px', height: menuButtonBounding.height + 'px' }">
<text class="iconfont icon-back_light"></text>
</view>
<view class="search" @click="$util.redirectTo('/pages_tool/goods/search')">
<text class="iconfont icon-sousuo3"></text>
<text class="tips">搜索商品</text>
</view>
<view class="sign"
:style="{ width: menuButtonBounding.height + 'px', height: menuButtonBounding.height + 'px' }"
@click="redirect('/pages_tool/member/signin')">
<image :src="$util.img('public/uniapp/point/navbar-sing-icon.png')" mode="widthFix"></image>
</view>
</view>
</view>
<view class="point-navbar-block" :style="{ height: menuButtonBounding.bottom + 'px' }"></view>
<!-- #endif -->
<scroll-view scroll-y="true" class="point-scroll-view" @scrolltolower="getData">
<view class="point-wrap" :style="{ 'background-position-y': -menuButtonBounding.bottom + 'px' }">
<view class="head-box">
<view class="account-content">
<view class="left">
<image :src="$util.img('public/uniapp/point/point-icon.png')" mode="widthFix"></image>
<view>我的积分</view>
</view>
<view class="right">
<text class="point price-font">{{ point }}</text>
<text class="text">积分</text>
<!-- <text class="iconfont icon-right"></text> -->
</view>
</view>
<view class="remark">
<view class="label">提醒</view>
<view class="text">积分兑好礼每日上新换不停</view>
</view>
</view>
<!-- <view class="menu-wrap">
<view class="menu-list">
<view class="menu-item" @click="openPointPopup()">
<image :src="$util.img('/public/uniapp/point/point-rule.png')" class="menu-img"></image>
<image :src="$util.img('/public/uniapp/point/must-see.png')" class="menu-tag"></image>
<view class="title">活动规则</view>
</view>
<view class="menu-item" @click="redirect('/pages_tool/recharge/list')">
<image :src="$util.img('/public/uniapp/point/recharge.png')" class="menu-img"></image>
<image :src="$util.img('/public/uniapp/point/high.png')" class="menu-tag"></image>
<view class="title">储值赚积分</view>
</view>
<view class="menu-item" @click="redirect('/pages_promotion/point/order_list')">
<image :src="$util.img('/public/uniapp/point/exchange-record.png')" class="menu-img"></image>
<view class="title">兑换记录</view>
</view>
<view class="menu-item" @click="luckdraw">
<image :src="$util.img('/public/uniapp/point/luck-draw.png')" class="menu-img"></image>
<view class="title">积分抽奖</view>
</view>
<view class="menu-item" @click="redirect('/pages_tool/member/point_detail')">
<image :src="$util.img('/public/uniapp/point/point-detail.png')" class="menu-img"></image>
<view class="title">积分明细</view>
</view>
</view>
</view> -->
<!--
<view class="poster-wrap">
<view class="poster-item" @click="redirect('/pages_tool/recharge/list')">
<image :src="$util.img('/public/uniapp/point/recharge-poster.png')" mode="widthFix"></image>
</view>
<view class="poster-item" @click="luckdraw">
<image :src="$util.img('/public/uniapp/point/luck-draw-poster.png')" mode="widthFix"></image>
</view>
</view> -->
<view class="recharge-list-wrap" @click="redirect('/pages_tool/recharge/list')"
v-if="rechargeList.length">
<view class="item-wrap" v-for="(item, index) in rechargeList.slice(0, 4)" :key="index">
<view class="recharge">储值{{ parseFloat(item.buy_price) }}</view>
<view class="point">可得{{ item.point }}积分</view>
<view class="btn">去储值</view>
</view>
</view>
<view class="body-wrap" :class="{ 'no-login': !storeToken }">
<view class="point-exchange-wrap exchange-coupon" v-if="couponList.length > 0">
<view class="card-category-title">
<text class="before-line"></text>
<text>积分换券</text>
<text class="after-line"></text>
</view>
<view class="list-wrap">
<view class="list-wrap-scroll" :class="{ 'single-row': couponList.length < 3 }">
<view class="list-wrap-item coupon-list-wrap-item"
v-for="(couponItem, couponIndex) in couponList" :key="couponIndex"
@click="toDetail(couponItem)">
<view class="img-box">
<image
:src="$util.img('public/uniapp/point/coupon_' + themeStyle.name + '_bg1.png')" />
</view>
<view class="content">
<view class="coupon"
:style="{ backgroundImage: 'url(' + $util.img('public/uniapp/point/coupon_theme-blue_bg1.jpg') + ')' }">
<view class="coupon_left color-line-border">
<view class="price price-font">
<block v-if="couponItem.coupon_type == 'reward'">
<text></text>
{{ parseFloat(couponItem.money) }}
</block>
<block v-if="couponItem.coupon_type == 'discount'">
<block v-if="couponItem.coupon_type == 'discount'">
{{ parseFloat(couponItem.discount) }}<text></text>
</block>
</block>
</view>
<view class="coupon-info">
<view class="coupon_condition font-size-activity-tag">
{{ couponItem.at_least == 0 ? '无门槛优惠券' : '满' +
parseFloat(couponItem.at_least).toFixed(0) + '可用' }}
</view>
<view class="coupon_type font-size-activity-tag"
v-if="couponItem.goods_type == 1">全场券</view>
<view class="coupon_type font-size-activity-tag"
v-else-if="couponItem.goods_type == 2 || couponItem.goods_type == 3">
指定券</view>
</view>
</view>
<view class="coupon_right">
<view class="coupon_num font-size-tag">{{ couponItem.point }}积分</view>
<view class="coupon_btn">兑换</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="point-exchange-wrap exchange-hongbao" v-if="hongbaoList.length > 0">
<view class="card-category-title">
<text class="before-line"></text>
<text>积分换红包</text>
<text class="after-line"></text>
</view>
<view class="list-wrap">
<view class="list-wrap-item hongbao-list-wrap-item"
v-for="(hongbaoItem, hongbaoIndex) in hongbaoList" :key="hongbaoIndex"
@click="toDetail(hongbaoItem)">
<view class="img-box">
<image :src="$util.img('public/uniapp/point/hongbao_bg.png')"></image>
</view>
<view class="content">
<view class="coupon hongbao">
<view class="coupon_left">
<view class="price price-font">
<text></text>
{{ parseFloat(hongbaoItem.balance).toFixed(0) }}
</view>
<!-- <view class="coupon_condition font-size-activity-tag">{{ hongbaoItem.name }}</view> -->
</view>
<view class="coupon_right">
<view class="coupon_num font-size-tag">{{ hongbaoItem.point }}积分</view>
<view class="coupon_btn">兑换</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="point-exchange-wrap" v-if="goodsList.length > 0">
<view class="card-category-title">
<text class="before-line"></text>
<text>积分换礼品</text>
<text class="after-line"></text>
</view>
<view class="list-wrap">
<view class="goods-list double-column" v-if="goodsList.length">
<view class="goods-item " v-for="(item, index) in goodsList" :key="index">
<view class="goods-img" @click="toDetail(item)">
<image :src="goodsImg(item)" mode="widthFix" @error="imgError(index)"></image>
</view>
<view class="info-wrap">
<view class="name-wrap">
<view class="goods-name" @click="toDetail(item)">{{ item.name }}</view>
</view>
<view class="lineheight-clear">
<view class="discount-price">
<view>
<text class="unit price-font point">{{ item.point }}</text>
<text class="unit font-size-tag ">积分</text>
</view>
<block v-if="item.price > 0 && item.pay_type > 0">
<text class="unit font-size-tag">+</text>
<view>
<text class="font-size-tag">{{
parseFloat(item.price).toFixed(2).split(".")[0] }}</text>
<text class="unit font-size-tag">.{{
parseFloat(item.price).toFixed(2).split(".")[1] }}</text>
</view>
</block>
</view>
<view class="btn" @click="toDetail(item)">兑换</view>
</view>
<view class="pro-info" v-if="item.stock_show || item.sale_show">
<view class="font-size-activity-tag color-tip" v-if="item.stock_show">
库存:{{ isNaN(parseInt(item.stock)) ? 0 : parseInt(item.stock) }}</view>
<view class="font-size-activity-tag color-tip sale" v-if="item.sale_show">
已兑:{{ isNaN(parseInt(item.sale_num)) ? 0 : parseInt(item.sale_num) }}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
<!-- 弹出规则 -->
<view @touchmove.prevent.stop>
<uni-popup ref="pointPopup" type="bottom">
<view class="tips-layer">
<view class="head" @click="closePointPopup()">
<view class="title">{{ isEnEnv ? 'Integral Description' : '积分说明' }}</view>
<text class="iconfont icon-close"></text>
</view>
<view class="body">
<view class="detail margin-bottom">
<view class="tip">{{ isEnEnv ? 'Integral Acquisition' : '积分的获取' }}</view>
<view class="font-size-base">1积分可在注册签到分享消费充值时获得</view>
<view class="font-size-base">2在购买部分商品时可获得积分</view>
<view class="tip">{{ isEnEnv ? 'Integral Use' : '积分的使用' }}</view>
<view class="font-size-base">1积分可用于兑换积分中心的商品</view>
<view class="font-size-base">2积分可在参与某些活动时使用</view>
<view class="font-size-base">3积分不得转让出售不设有效期</view>
<view class="tip">{{ isEnEnv ? 'Integral Query' : '积分的查询' }}</view>
<view class="font-size-base">1积分可在会员中心中查询具体数额以及明细</view>
</view>
</view>
</view>
</uni-popup>
</view>
<loading-cover ref="loadingCover"></loading-cover>
<ns-login ref="login"></ns-login>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
</view>
</template>
<script>
export default {
components: {
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
nsSelectTime: () => import('@/components/ns-select-time/ns-select-time.vue'),
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsPayment: () => import('@/components/payment/payment.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
},
data() {
return {
mescroll: {
num: 0,
total: 1,
loading: false
},
categoryList: [{
id: 1,
name: '积分换好物'
},
{
id: 2,
name: '积分换券'
},
{
id: 3,
name: '积分换红包'
}
],
isLogin: false,
goodsList: [],
couponList: [],
hongbaoList: [],
point: 0,
signState: 1, // 签到是否开启
mpShareData: null, //小程序分享数据
menuButtonBounding: {
bottom: 0
},
rechargeList: [], //充值套餐
newestGame: null
};
},
onLoad(option) {
setTimeout(() => {
if (!this.addonIsExist.pointexchange) {
this.$util.showToast({
title: '商家未开启积分商城',
mask: true,
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
}, 1000);
// #ifdef MP-WEIXIN
this.menuButtonBounding = uni.getMenuButtonBoundingClientRect();
// #endif
//小程序分享接收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);
});
}
}
this.getData();
this.getRechargeList();
this.getNewestGame();
},
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
if (this.storeToken) this.getAccountInfo();
this.getCouponList();
this.getHongbaoList();
// this.getSignState();
},
methods: {
// 签到是否开启
getSignState() {
this.$api.sendRequest({
url: '/api/membersignin/getSignStatus',
success: res => {
if (res.code == 0) {
this.signState = res.data.is_use;
}
}
});
},
jumpPage(url) {
this.$util.redirectTo(url);
},
// 打开积分说明弹出层
openPointPopup() {
this.$refs.pointPopup.open();
},
// 打开积分说明弹出层
closePointPopup() {
this.$refs.pointPopup.close();
},
// 优惠券
getCouponList() {
this.$api.sendRequest({
url: '/pointexchange/api/goods/page',
data: {
page_size: 0,
type: 2
},
success: res => {
if (res.code == 0 && res.data) {
this.couponList = res.data.list;
} else {
this.$util.showToast({
title: res.message
});
}
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
//联网失败的回调
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
// 红包
getHongbaoList() {
this.$api.sendRequest({
url: '/pointexchange/api/goods/page',
data: {
page_size: 0,
type: 3
},
success: res => {
if (res.code == 0 && res.data) {
this.hongbaoList = res.data.list;
} else {
this.$util.showToast({
title: res.message
});
}
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
//联网失败的回调
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
//获取积分商品详情
getData() {
if (this.mescroll.loading || this.mescroll.num >= this.mescroll.total) return;
this.mescroll.loading = true;
this.$api.sendRequest({
url: '/pointexchange/api/goods/page',
data: {
page: this.mescroll.num + 1,
page_size: 10,
type: 1
},
success: res => {
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
//设置列表数据
this.mescroll.loading = false;
this.mescroll.total = res.data.page_count;
this.mescroll.num += 1;
if (this.mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
this.goodsList = this.goodsList.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
this.mescroll.loading = false;
//联网失败的回调
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
//跳转至详情页面
toDetail(item) {
this.$util.redirectTo('/pages_promotion/point/detail', {
id: item.id
});
},
goGoodsList() {
this.$util.redirectTo('/pages_promotion/point/goods_list');
},
//获取个人
getAccountInfo() {
this.$api.sendRequest({
url: '/api/memberaccount/info',
data: {
account_type: 'point'
},
success: res => {
if (res.code == 0 && res.data) {
if (!isNaN(parseFloat(res.data.point))) {
this.point = parseFloat(res.data.point).toFixed(0);
}
} else {
this.$util.showToast({
title: res.message
});
}
}
});
},
//跳转至登录页面
login() {
this.$refs.login.open('/pages_promotion/point/list');
},
imgError(index) {
this.goodsList[index].image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
},
goodsImg(data) {
let img = '';
switch (data.type) {
case 1:
img = this.$util.img(data.image.split(',')[0], {
size: 'mid'
});
break;
case 2:
img = data.image ? this.$util.img(data.image) : this.$util.img(
'public/uniapp/point/coupon.png');
break;
case 3:
img = data.image ? this.$util.img(data.image) : this.$util.img(
'public/uniapp/point/hongbao.png');
break;
}
return img;
},
/**
* 跳转
* @param {Object} url
*/
redirect(url) {
if (!this.storeToken) {
this.$refs.login.open(url);
} else {
this.$util.redirectTo(url);
}
},
getRechargeList() {
this.$api.sendRequest({
url: '/memberrecharge/api/memberrecharge/page',
data: {
page_size: 100,
page: 1
},
success: res => {
if (res.code == 0 && res.data) {
let rechargeList = [];
res.data.list.forEach(item => {
if (item.point > 0) rechargeList.push(item)
});
this.rechargeList = rechargeList;
}
}
})
},
back() {
if (getCurrentPages().length > 1) uni.navigateBack({
delta: 1
});
else this.$util.redirectTo('/pages/index/index');
},
getNewestGame() {
this.$api.sendRequest({
url: '/api/game/newestgame',
success: res => {
if (res.code == 0 && res.data) this.newestGame = res.data;
}
})
},
luckdraw() {
if (this.newestGame) {
switch (this.newestGame.game_type) {
case 'cards':
this.$util.redirectTo('/pages_promotion/game/cards', {
id: this.newestGame.game_id
});
break;
case 'egg':
this.$util.redirectTo('/pages_promotion/game/smash_eggs', {
id: this.newestGame.game_id
});
break;
case 'turntable':
this.$util.redirectTo('/pages_promotion/game/turntable', {
id: this.newestGame.game_id
});
break;
}
} else {
this.$util.showToast({
title: '暂无相关活动'
});
}
}
},
//分享给好友
onShareAppMessage() {
return this.mpShareData.appMessage;
},
//分享到朋友圈
onShareTimeline() {
return this.mpShareData.timeLine;
}
};
</script>
<style lang="scss">
@import '@/pages_promotion/point/public/css/list.scss';
</style>
<style>
.ns-adv>>>image {
width: 100%;
border-radius: 0;
}
</style>

View File

@@ -195,23 +195,18 @@
</view>
</template>
<script>
import htmlParser from '@/common/js/html-parser.js';
import uniPopup from '@/components/uni-popup/uni-popup.vue';
import uniNumberBox from '@/components/uni-number-box/uni-number-box.vue';
import htmlParser from '@/common/js/html-parser';
import nsGoodsSku from '@/components/ns-goods-sku/ns-goods-sku.vue';
import toTop from '@/components/toTop/toTop.vue';
import scroll from '@/common/js/scroll-view.js';
export default {
components: {
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
uniNumberBox: () => import('@/components/uni-number-box/uni-number-box.vue'),
nsGoodsSku: () => import('@/components/ns-goods-sku/ns-goods-sku.vue'),
toTop: () => import('@/components/toTop/toTop.vue'),
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsPayment: () => import('@/components/payment/payment.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
uniPopup,
uniNumberBox,
nsGoodsSku,
toTop
},
data() {
return {
@@ -503,7 +498,7 @@ export default {
}
}
</style>
<style lang="scss" scoped>
<style scoped>
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
max-height: unset !important;
}

View File

@@ -1,603 +0,0 @@
<template>
<view class="order-container" :style="themeColor">
<view class="order-nav" v-if="storeToken">
<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="statusItem.status == orderStatus ? 'uni-tab-item-title-active color-base-text' : ''">
{{ statusItem.name }}
</text>
</view>
</view>
<mescroll-uni ref="mescroll" @getData="getListData" top="80rpx">
<block slot="list">
<block v-if="orderList.length">
<view class="order-item" v-for="(orderItem, orderIndex) in orderList" :key="orderIndex"
@click="detail(orderItem)">
<view class="order-header">
<text class="order-no">订单号{{ orderItem.order_no }}</text>
<text class="status-name">
{{ orderItem.order_status == 0 ? '待支付' : orderItem.order_status == 1 ? '已完成' :
orderItem.order_status == -1 ? '已关闭' : '' }}
</text>
</view>
<view class="order-body">
<view class="goods-wrap">
<view class="goods-img">
<block v-if="orderItem.type == 2">
<image
:src="$util.img(orderItem.exchange_image) ? $util.img(orderItem.exchange_image) : $util.img('public/uniapp/point/coupon.png')"
@error="imageError(orderIndex)" mode="aspectFill" :lazy-load="true"></image>
</block>
<block v-else-if="orderItem.type == 3">
<image
:src="$util.img(orderItem.exchange_image) ? $util.img(orderItem.exchange_image) : $util.img('public/uniapp/point/hongbao.png')"
@error="imageError(orderIndex)" mode="aspectFill" :lazy-load="true"></image>
</block>
<block v-else>
<image :src="$util.img(orderItem.exchange_image)"
@error="imageError(orderIndex)" mode="aspectFill" :lazy-load="true"></image>
</block>
</view>
<view class="goods-info">
<view class="pro-info">
<view class="goods-name">{{ orderItem.exchange_name }}</view>
<view class="goods-sub-section">
<text class="goods-price">
<text class="price-style large">{{ orderItem.point }}</text>
<text class="unit price-style small">积分</text>
<block v-if="orderItem.price > 0">
+
<text class="unit price-style small">{{
$lang('common.currencySymbol') }}</text>
<text class="price-style large">{{
parseFloat(orderItem.price).toFixed(2).split(".")[0] }}</text>
<text class="unit price-style small">.{{
parseFloat(orderItem.price).toFixed(2).split(".")[1] }}</text>
</block>
</text>
<text class="goods-num">
<text class="iconfont icon-close"></text>
{{ orderItem.num }}
</text>
</view>
</view>
</view>
</view>
</view>
<view class="order-footer">
<view class="order-action" v-if="orderItem.order_status == 0 && orderItem.type == 1">
<view class="order-box-btn font-size-tag"
@click.stop="orderClose(orderItem.order_id, orderIndex)">关闭</view>
<view class="order-box-btn color-base-bg color-base-border"
@click.stop="openChoosePayment(orderItem.out_trade_no, orderItem.price)">支付</view>
</view>
<view class="order-action" v-else>
<view class="order-box-btn font-size-tag">查看详情</view>
</view>
</view>
</view>
</block>
<block v-if="showEmpty && !orderList.length">
<view class="cart-empty">
<ns-empty :isIndex="true" :emptyBtn="{ url: '/pages_promotion/point/list', text: '去逛逛' }"
text="暂无积分兑换订单"></ns-empty>
</view>
</block>
</block>
</mescroll-uni>
<!-- 选择支付方式弹窗 -->
<ns-payment ref="choosePaymentPopup" :payMoney="payMoney" @confirm="orderPay"></ns-payment>
<loading-cover ref="loadingCover"></loading-cover>
<ns-login ref="login"></ns-login>
</view>
</template>
<script>
export default {
components: {
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
nsSelectTime: () => import('@/components/ns-select-time/ns-select-time.vue'),
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsPayment: () => import('@/components/payment/payment.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
},
data() {
return {
orderList: [],
showEmpty: false,
outTradeNo: '',
payMoney: 0,
statusList: [
{ status: 'all', id: 'all', name: '全部' },
{ status: 0, id: 'pay', name: '待支付' },
{ status: 1, id: 'complete', name: '已完成' },
],
orderStatus: 'all',
};
},
onLoad() {
setTimeout(() => {
if (!this.addonIsExist.pointexchange) {
this.$util.showToast({
title: '商家未开启积分商城',
mask: true,
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index', {}, 'redirectTo');
}, 2000);
}
}, 1000);
if (!this.storeToken) {
this.$nextTick(() => {
this.$refs.login.open('/pages_promotion/point/order_list');
});
}
},
onShow() {
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
},
watch: {
storeToken: function (nVal, oVal) {
if (nVal) {
this.$refs.mescroll.refresh();
}
}
},
methods: {
ontabtap(e) {
let index = e.target.dataset.current || e.currentTarget.dataset.current;
this.orderStatus = this.statusList[index].status;
this.$refs.loadingCover.show();
this.$refs.mescroll.refresh();
},
getListData(mescroll) {
this.showEmpty = false;
this.$api.sendRequest({
url: '/pointexchange/api/order/page',
data: {
page: mescroll.num,
page_size: mescroll.size,
order_status: this.orderStatus
},
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.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();
}
});
},
orderClose(order_id, index) {
uni.showModal({
title: '提示',
content: '确定关闭此次兑换?',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/pointexchange/api/order/close',
data: {
order_id: order_id
},
success: res => {
if (res.code >= 0) {
this.orderList[index].order_status = -1;
this.$util.showToast({
title: '关闭成功'
});
this.$forceUpdate();
}
}
});
}
}
});
},
// 显示选择支付方式弹框
openChoosePayment(out_trade_no, price) {
this.outTradeNo = out_trade_no;
this.payMoney = parseFloat(price);
this.$refs.choosePaymentPopup.open();
},
orderPay() {
this.$refs.choosePaymentPopup.getPayInfo(this.outTradeNo);
},
detail(item) {
if (item.type == 1 && item.relate_order_id) {
switch (item.delivery_type) {
case 'store':
this.$util.redirectTo('/pages_order/detail/detail_pickup', {
order_id: item.relate_order_id
});
break;
case 'local':
this.$util.redirectTo('/pages_order/detail/detail_local_delivery', {
order_id: item.relate_order_id
});
break;
case 'express':
this.$util.redirectTo('/pages_order/detail/detail', {
order_id: item.relate_order_id
});
break;
default:
this.$util.redirectTo('/pages_tool/order/detail_virtual', {
order_id: item.relate_order_id
});
}
} else {
this.$util.redirectTo('/pages_order/detail/detail_point', {
order_id: item.order_id
});
}
},
imageError(index) {
this.orderList[index].exchange_image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .fixed {
position: relative;
top: 0;
}
/deep/ .empty {
padding-top: 0 !important;
}
.order-container {
width: 100vw;
height: 100vh;
}
.align-right {
text-align: right;
}
.order-item {
margin: $margin-updown 24rpx;
border-radius: 12rpx;
background: #fff;
position: relative;
.order-header {
display: flex;
align-items: center;
position: relative;
padding: $padding 24rpx 26rpx 24rpx;
&.waitpay {
padding-left: 70rpx;
.iconyuan_checked,
.iconyuan_checkbox {
font-size: $font-size-toolbar;
position: absolute;
top: 48%;
left: 20rpx;
transform: translateY(-50%);
}
.iconyuan_checkbox {
color: $color-tip;
}
}
.icondianpu {
display: inline-block;
line-height: 1;
margin-right: 12rpx;
font-size: $font-size-base;
}
.order-no {
font-size: 26rpx;
}
.status-name {
flex: 1;
text-align: right;
font-size: 26rpx;
font-weight: 600;
}
}
.order-body {
.goods-wrap {
display: flex;
position: relative;
padding: 0 24rpx 30rpx 24rpx;
&:last-of-type {
margin-bottom: 0;
}
.goods-img {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
image {
width: 100%;
height: 100%;
border-radius: $border-radius;
}
}
.goods-info {
flex: 1;
position: relative;
max-width: calc(100% - 180rpx);
display: flex;
flex-direction: column;
.pro-info {
flex: 1;
}
.goods-name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
line-height: 1.5;
font-size: $font-size-base;
color: $color-title;
}
.goods-sub-section {
width: 100%;
line-height: 1.3;
display: flex;
margin-top: 14rpx;
.goods-price {
font-size: $font-size-tag;
color: var(--price-color);
flex: 1;
font-weight: bold;
}
.goods-num {
font-size: $font-size-tag;
color: $color-tip;
flex: 1;
text-align: right;
line-height: 1;
.iconfont {
font-size: $font-size-tag;
}
}
.goods-type {
font-size: $font-size-tag;
}
.unit {
font-size: $font-size-tag;
margin-right: 2rpx;
}
view {
flex: 1;
line-height: 1.3;
display: flex;
flex-direction: column;
&:last-of-type {
text-align: right;
.iconfont {
line-height: 1;
font-size: $font-size-tag;
}
}
}
}
.goods-action {
text-align: right;
.action-btn {
line-height: 1;
padding: 14rpx 20rpx;
color: $color-title;
display: inline-block;
border-radius: $border-radius;
background: #fff;
border: 2rpx solid #999;
font-size: $font-size-tag;
margin-left: 10rpx;
}
}
}
}
.multi-order-goods {
width: calc(100vw - 96rpx);
white-space: nowrap;
margin: 0 24rpx 30rpx 24rpx !important;
position: relative;
.scroll-view {
width: 100%;
}
.goods-wrap {
padding: 0;
}
.goods-img {
min-width: 160rpx;
}
.shade {
position: absolute;
z-index: 5;
height: 100%;
width: 44rpx;
right: 0;
top: 0;
image {
width: 100%;
height: 100%;
}
}
}
}
.order-footer {
.order-base-info {
.total {
padding: $padding;
font-size: $font-size-tag;
background: rgba(248, 248, 248, 0.5);
display: flex;
margin: 0 24rpx;
&>text {
flex: 1;
line-height: 1;
margin-left: 10rpx;
}
}
.order-type {
padding-top: 20rpx;
flex: 0.5;
&>text {
line-height: 1;
}
}
}
.order-action {
text-align: right;
padding: 30rpx 24rpx;
position: relative;
.order-time {
position: absolute;
top: 35rpx;
left: 30rpx;
display: flex;
align-items: center;
font-size: 10px;
color: #b5b6b9;
image {
width: 26rpx;
height: 26rpx;
margin-right: 6rpx;
}
}
.action-btn {
line-height: 1;
padding: 20rpx 26rpx;
color: #333;
display: inline-block;
border-radius: $border-radius;
background: #fff;
border: 2rpx solid #999;
font-size: $font-size-tag;
margin-left: 10rpx;
}
}
}
}
.empty {
padding-top: 200rpx;
text-align: center;
.empty-image {
width: 180rpx;
height: 180rpx;
}
}
.order-nav {
width: 100vw;
height: 80rpx;
flex-direction: row;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
background: #fff;
display: flex;
position: fixed;
left: 0;
z-index: 998;
justify-content: space-around;
border-radius: 0px 0px 24rpx 24rpx;
.uni-tab-item {
width: 120rpx;
text-align: center;
}
.uni-tab-item-title {
display: inline-block;
height: 80rpx;
line-height: 80rpx;
border-bottom: 1px solid #fff;
flex-wrap: nowrap;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
text-align: center;
font-size: 30rpx;
position: relative;
}
.uni-tab-item-title-active::after {
content: " ";
display: block;
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 6rpx;
background: linear-gradient(270deg, var(--base-color-light-9) 0%, var(--base-color) 100%);
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
}
</style>

View File

@@ -1,92 +0,0 @@
<template>
<view class="container" :style="themeColor">
<view class="image-wrap">
<image :src="$util.img('public/uniapp/pay/pay_success.png')" class="result-image" mode="widthFix"></image>
</view>
<view class="msg">{{ $lang('exchangeSuccess') }}</view>
<view class="action">
<view class="btn color-base-border color-base-text" @click="toOrderList()">{{ $lang('see') }}</view>
<view class="btn go-home color-base-bg" @click="toIndex">{{ $lang('goHome') }}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
onShow() {
},
methods: {
toOrderList() {
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
},
toIndex() {
this.$util.redirectTo('/pages/index/index');
}
}
};
</script>
<style lang="scss">
.container {
width: 100vw;
height: 100vh;
background: #fff;
.image-wrap {
display: flex;
justify-content: center;
padding: 200rpx 0 40rpx 0;
.result-image {
width: 166rpx;
}
}
.msg {
text-align: center;
line-height: 1;
margin-bottom: 50rpx;
font-size: $font-size-base;
color: #000;
}
.pay-amount {
color: #999;
text-align: center;
line-height: 1;
margin-bottom: 30rpx;
}
.action {
width: 90%;
margin: 0 auto;
text-align: center;
margin-top: 150rpx;
display: flex;
justify-content: space-between;
.btn {
width: 310rpx;
height: 78rpx;
border: 2rpx solid #ffffff;
border-radius: $border-radius;
font-size: $font-size-tag;
display: flex;
align-items: center;
justify-content: center;
}
.alone {
margin-left: 0;
width: 60%;
}
.go-home {
color: #fff;
}
}
}
</style>

View File

@@ -0,0 +1,907 @@
<template>
<view class="content" :style="themeColor">
<view class="head-wrap">
<!-- 搜索区域 -->
<view class="search-wrap uni-flex uni-row">
<view class="flex-item input-wrap" @click.stop="search()" @tap.stop="search()">
<input class="uni-input" maxlength="50" v-model="keyword" confirm-type="search" @confirm="search()" @click.stop="search()" @tap.stop="search()" :placeholder="isEnEnv ? 'Please enter product keywords' : '请输入商品关键词'" />
<text class="iconfont icon-sousuo3" @click.stop="search()" @tap.stop="search()"></text>
</view>
</view>
<!-- 排序 -->
<view class="sort-wrap">
<view class="comprehensive-wrap" :class="{ 'color-base-text': order === '' }" @click="sortTabClick('')">
<text :class="{ 'color-base-text': order === '' }">{{ isEnEnv ? 'Comprehensive' : '综合' }}</text>
</view>
<view class="price-wrap" @click="sortTabClick('point')">
<text :class="{ 'color-base-text': order === 'point' }">{{ isEnEnv ? 'Points' : '积分' }}</text>
<view class="iconfont-wrap">
<view class="iconfont icon-shangsanjiao-copy" :class="{ 'color-base-text': priceOrder === 'asc' && order === 'point' }"></view>
<view class="iconfont icon-sanjiao" :class="{ 'color-base-text': priceOrder === 'desc' && order === 'point' }"></view>
</view>
</view>
<view class="price-wrap" @click="sortTabClick('create_time')">
<text :class="{ 'color-base-text': order === 'create_time' }">{{ isEnEnv ? 'New Arrival' : '上新时间' }}</text>
<view class="iconfont-wrap">
<view class="iconfont icon-shangsanjiao-copy" :class="{ 'color-base-text': priceOrder === 'asc' && order === 'create_time' }"></view>
<view class="iconfont icon-sanjiao" :class="{ 'color-base-text': priceOrder === 'desc' && order === 'create_time' }"></view>
</view>
</view>
<view :class="{ 'color-base-text': order === 'screen' }" class="screen-wrap">
<text @click="sortTabClick('screen')">{{ isEnEnv ? 'Filter' : '筛选' }}</text>
<view @click="sortTabClick('screen')" class="iconfont-wrap">
<view class="iconfont icon-shaixuan color-tip"></view>
</view>
</view>
</view>
</view>
<mescroll-uni top="180" @getData="getData" ref="mescroll" :size="10">
<block slot="list">
<view class="list-wrap">
<view class="goods-list double-column" v-if="goodsList.length">
<view class="goods-item margin-bottom" v-for="(item, index) in goodsList" :key="index">
<view class="goods-img" @click="toDetail(item)">
<image :src="goodsImg(item.image)" mode="widthFix" @error="imgError(index)"></image>
</view>
<view class="info-wrap">
<view class="name-wrap">
<view class="goods-name" @click="toDetail(item)">{{ isEnEnv ? item.en_goods_name : item.goods_name }}</view>
</view>
<view class="lineheight-clear">
<view class="discount-price">
<text class="unit ">{{ item.point }}</text>
<text class="unit font-size-tag">{{ isEnEnv ? 'Points' : '积分' }}</text>
<block v-if="item.price > 0 && item.pay_type > 0">
<text class="unit font-size-tag">+</text>
<text class="unit font-size-tag">{{ $lang('common.currencySymbol') }}</text>
<text class="price font-size-toolbar" >{{ parseFloat(item.price).toFixed(2).split(".")[0] }}</text>
<text class="unit font-size-tag">.{{ parseFloat(item.price).toFixed(2).split(".")[1] }}</text>
</block>
</view>
</view>
<view class="pro-info" v-if="item.stock_show">
<view class="font-size-activity-tag color-tip">{{ isEnEnv ? 'Stock ' : '库存' }}{{ item.stock }}</view>
<view class="sale font-size-activity-tag color-tip" @click="toDetail(item)">
<!-- <button type="primary" size="mini">立即兑换</button> -->
</view>
</view>
</view>
</view>
</view>
<view class="empty" v-if="goodsList.length == 0">
<ns-empty :isIndex="false" :text="isEnEnv ? 'No point products available' : '暂无积分商品'"></ns-empty>
</view>
</view>
</block>
</mescroll-uni>
<!-- 筛选弹出框 -->
<uni-drawer :visible="showScreen" mode="right" @close="showScreen = false" class="screen-wrap">
<view class="title color-tip">{{ isEnEnv ? 'Filter' : '筛选' }}</view>
<scroll-view scroll-y>
<!-- 价格筛选项 -->
<view class="item-wrap">
<view class="label"><text>{{ isEnEnv ? 'Point Range' : '积分区间' }}</text></view>
<view class="price-wrap">
<input class="uni-input" type="digit" v-model="minPoint" :placeholder="isEnEnv ? 'Min' : '最低'" />
<view class="h-line"></view>
<input class="uni-input" type="digit" v-model="maxPoint" :placeholder="isEnEnv ? 'Max' : '最高'" />
</view>
</view>
<!-- 分类筛选项 -->
<view class="category-list-wrap">
<text class="first">{{ isEnEnv ? 'All Categories' : '全部分类' }}</text>
<view class="class-box">
<view @click="selectedCategory('')" class="list-wrap"><text :class="{ selected: !categoryId, 'color-base-text': !categoryId }">{{ isEnEnv ? 'All' : '全部' }}</text></view>
<view @click="selectedCategory(item.category_id)" v-for="(item, index) in categoryList" :key="index" class="list-wrap">
<text :class="{ selected: item.category_id == categoryId, 'color-base-text': item.category_id == categoryId }">{{ item.category_name }}</text>
</view>
</view>
</view>
</scroll-view>
<view class="footer" :class="{ 'safe-area': isIphoneX }">
<button type="default" class="footer-box" @click="resetData">{{ isEnEnv ? 'Reset' : '重置' }}</button>
<button type="primary" class="footer-box1" @click="screenData">{{ isEnEnv ? 'Confirm' : '确定' }}</button>
</view>
</uni-drawer>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
</view>
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
import uniDrawer from '@/components/uni-drawer/uni-drawer.vue';
export default {
components: {
uniDrawer,
MescrollUni,
nsLogin,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
listStyle: '',
priceOrder: 'desc',
categoryList: [], //排序类型
goodsList: [],
order: '',
sort: 'desc',
showScreen: false,
keyword: '',
categoryId: 0,
minPoint: '',
maxPoint: '',
isFreeShipping: false, //是否免邮
isIphoneX: false,
coupon: 0,
emptyShow: false,
isList: true, //列表样式
mescroll: null,
isLogin: false,
couponList: [],
hongbaoList: [],
point: 0,
};
},
onLoad(options) {
this.categoryId = options.category_id || 0;
this.keyword = options.keyword || '';
this.isIphoneX = this.$util.uniappIsIPhoneX();
this.coupon = options.coupon || 0;
this.loadCategoryList(this.categoryId);
},
methods: {
//获取积分商品详情
getData(mescroll) {
this.$api.sendRequest({
url: '/pointexchange/api/goods/page',
data: {
page_size: mescroll.size,
page: mescroll.num,
type: 1,
keyword: this.keyword,
category_id: this.categoryId,
min_point: this.minPoint,
max_point: this.maxPoint,
is_free_shipping: (this.isFreeShipping ? 1 : 0),
order: this.order,
sort: this.sort,
coupon: this.coupon
},
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.goodsList = []; //如果是第一页需手动制空列表
this.goodsList = this.goodsList.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
//联网失败的回调
mescroll.endErr();
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
//加载分类
loadCategoryList(fid, sid) {
this.$api.sendRequest({
url: '/api/goodscategory/tree',
data: {},
success: res => {
if (res.data != null) this.categoryList = res.data;
}
});
},
goodsImg(imgStr) {
let imgs = imgStr.split(',');
return imgs[0] ? this.$util.img(imgs[0], {
size: 'mid'
}) : this.$util.getDefaultImage().goods;
},
imgError(index) {
this.goodsList[index].goods_image = this.$util.getDefaultImage().goods;
},
//跳转至详情页面
toDetail(item) {
this.$util.redirectTo('/pages_promotion/point/detail', {
id: item.id
});
},
search() {
this.emptyShow = false;
this.goodsList = [];
this.$refs.mescroll.refresh();
},
//筛选点击
sortTabClick(tag) {
if (tag == 'point') {
this.order = 'point';
this.sort = 'desc';
} else if (tag == 'create_time') {
this.order = 'create_time';
this.sort = 'desc';
} else if (tag == 'screen') {
//筛选
this.showScreen = true;
return;
} else {
this.order = '';
this.sort = '';
}
this.order = tag;
if (tag === 'create_time') {
this.priceOrder = this.priceOrder === 'asc' ? 'desc' : 'asc';
this.sort = this.priceOrder;
} else if (tag === 'point') {
this.priceOrder = this.priceOrder === 'asc' ? 'desc' : 'asc';
this.sort = this.priceOrder;
}
this.emptyShow = false;
this.goodsList = [];
this.$refs.mescroll.refresh();
},
selectedCategory(categoryId) {
this.categoryId = categoryId;
},
screenData() {
if (this.minPoint != '' || this.maxPoint != '') {
// if (!Number(this.minPoint) && this.minPoint) {
// this.$util.showToast({
// title: '请输入最低价'
// });
// return;
// }
if (!Number(this.maxPoint) && this.maxPoint) {
this.$util.showToast({
title: this.isEnEnv ? 'Please enter the maximum price' : '请输入最高价'
});
return;
}
if (Number(this.minPoint) < 0 || Number(this.maxPoint) < 0) {
this.$util.showToast({
title: this.isEnEnv ? 'Filter price cannot be less than 0' : '筛选价格不能小于0'
});
return;
}
if (this.minPoint != '' && Number(this.minPoint) > Number(this.maxPoint) && this.maxPoint) {
this.$util.showToast({
title: this.isEnEnv ? 'Minimum price cannot be greater than maximum price' : '最低价不能大于最高价'
});
return;
}
if (this.maxPoint != '' && Number(this.maxPoint) < Number(this.minPoint)) {
this.$util.showToast({
title: this.isEnEnv ? 'Maximum price cannot be less than minimum price' : '最高价不能小于最低价'
});
return;
}
}
this.emptyShow = false;
this.goodsList = [];
this.$refs.mescroll.refresh();
this.showScreen = false;
},
//重置数据
resetData() {
this.showScreen = false;
this.categoryId = 0
this.minPoint = ''
this.maxPoint = ''
},
},
};
</script>
<style lang="scss">
.head-wrap {
background: #fff;
position: fixed;
width: 100%;
left: 0;
z-index: 1;
.search-wrap {
flex: 0.5;
padding: 30rpx 30rpx 0;
font-size: $font-size-tag;
display: flex;
align-items: center;
.input-wrap {
flex: 1;
display: flex;
justify-content: space-between;
align-items: center;
background: $color-bg;
height: 70rpx;
padding-left: 10rpx;
border-radius: 70rpx;
input {
width: 90%;
background: $color-bg;
font-size: $font-size-tag;
height: 50rpx;
padding: 10rpx 25rpx 10rpx 40rpx;
line-height: 50rpx;
border-radius: 40rpx;
}
text {
font-size: $font-size-toolbar;
color: $color-tip;
width: 80rpx;
text-align: center;
margin-right: 20rpx;
}
}
.category-wrap,
.list-style {
display: flex;
justify-content: center;
align-items: center;
.iconfont {
font-size: 50rpx;
color: $color-tip;
}
text {
display: block;
margin-top: 60rpx;
}
}
}
.sort-wrap {
display: flex;
padding: 10rpx 20rpx 10rpx 0;
>view {
flex: 1;
text-align: center;
font-size: $font-size-base;
height: 60rpx;
line-height: 60rpx;
}
.comprehensive-wrap {
display: flex;
justify-content: center;
align-items: center;
.iconfont-wrap {
display: inline-block;
margin-left: 10rpx;
width: 40rpx;
.iconfont {
font-size: $font-size-toolbar;
line-height: 1;
margin-bottom: 5rpx;
}
}
}
.price-wrap {
display: flex;
justify-content: center;
align-items: center;
.iconfont-wrap {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 40rpx;
.iconfont {
float: left;
font-size: 24rpx;
line-height: 1;
height: 20rpx;
color: #909399;
}
}
}
.screen-wrap {
display: flex;
justify-content: center;
align-items: center;
.iconfont-wrap {
display: inline-block;
margin-left: 10rpx;
width: 40rpx;
.iconfont {
font-size: $font-size-toolbar;
line-height: 1;
}
}
}
}
}
.category-list-wrap {
height: 100%;
.class-box {
display: flex;
flex-wrap: wrap;
padding: 0 $padding;
view {
width: calc((100% - 60rpx) / 3);
font-size: $font-size-goods-tag;
margin-right: 20rpx;
height: 60rpx;
line-height: 60rpx;
text-align: center;
margin-bottom: 12rpx;
flex-shrink: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
background: rgba(245, 245, 245, 1);
border-radius: 5rpx;
&:nth-of-type(3n) {
margin-right: 0;
}
}
}
.first {
font-size: $font-size-tag;
display: block;
// background: $page-color-base;
padding: 20rpx;
}
.second {
border-bottom: 2rpx solid $color-line;
padding: 20rpx;
display: block;
font-size: $font-size-tag;
}
.third {
padding: 0 20rpx 20rpx;
overflow: hidden;
font-size: $font-size-tag;
>view {
display: inline-block;
margin-right: 20rpx;
margin-top: 20rpx;
}
.uni-tag {
padding: 0 20rpx;
}
}
}
.screen-wrap {
.title {
font-size: $font-size-tag;
padding: $padding;
background: #f6f4f5;
}
scroll-view {
height: 85%;
.item-wrap {
border-bottom: 1px solid #f0f0f0;
.label {
font-size: $font-size-tag;
padding: $padding;
view {
display: inline-block;
font-size: 60rpx;
height: 40rpx;
vertical-align: middle;
line-height: 40rpx;
}
}
.list {
margin: $margin-updown $margin-both;
overflow: hidden;
>view {
display: inline-block;
margin-right: 25rpx;
margin-bottom: 25rpx;
}
.uni-tag {
padding: 0 $padding;
font-size: $font-size-goods-tag;
background: #f5f5f5;
height: 52rpx;
line-height: 52rpx;
border: 0;
}
}
.price-wrap {
display: flex;
justify-content: center;
align-items: center;
padding: $padding;
input {
flex: 1;
background: #f5f5f5;
height: 52rpx;
width: 182rpx;
line-height: 50rpx;
font-size: $font-size-goods-tag;
border-radius: 50rpx;
text-align: center;
&:first-child {
margin-right: 10rpx;
}
&:last-child {
margin-left: 10rpx;
}
}
}
}
}
.footer {
height: 90rpx;
display: flex;
justify-content: center;
align-items: flex-start;
//position: absolute;
bottom: 0;
width: 100%;
.footer-box {
border-top-right-radius: 0;
border-bottom-right-radius: 0;
margin: 0;
width: 40%;
}
.footer-box1 {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
margin: 0;
width: 40%;
}
}
}
.safe-area {
bottom: 68rpx !important;
}
.empty {
margin-top: 100rpx;
}
.buy-num {
font-size: $font-size-activity-tag;
}
.icon {
width: 34rpx;
height: 30rpx;
}
.list-style-new {
display: flex;
align-items: center;
.line {
width: 4rpx;
height: 28rpx;
background-color: rgba(227, 227, 227, 1);
margin-right: 60rpx;
}
}
.h-line {
width: 37rpx;
height: 2rpx;
background-color: $color-tip;
}
.lineheight-clear {
line-height: 1 !important;
}
// 商品列表单列样式
.goods-list.single-column {
.goods-item {
padding: 26rpx;
background: #fff;
margin: $margin-updown $margin-both;
border-radius: $border-radius;
display: flex;
position: relative;
.goods-img {
width: 200rpx;
height: 200rpx;
overflow: hidden;
border-radius: $border-radius;
margin-right: 20rpx;
image {
width: 100%;
height: 100%;
}
}
.goods-tag {
color: #fff;
line-height: 1;
padding: 8rpx 12rpx;
position: absolute;
border-top-left-radius: $border-radius;
border-bottom-right-radius: $border-radius;
top: 26rpx;
left: 26rpx;
font-size: $font-size-goods-tag;
}
.goods-tag-img {
position: absolute;
border-top-left-radius: $border-radius;
width: 80rpx;
height: 80rpx;
top: 26rpx;
left: 26rpx;
z-index: 5;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.info-wrap {
flex: 1;
display: flex;
flex-direction: column;
}
.name-wrap {
flex: 1;
}
.goods-name {
font-size: $font-size-base;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
height: 68rpx;
}
.introduction {
line-height: 1;
margin-top: 10rpx;
}
.discount-price {
display: inline-block;
font-weight: bold;
line-height: 1;
margin-top: 16rpx;
color: var(--price-color);
.unit {
margin-right: 6rpx;
}
}
.pro-info {
display: flex;
margin-top: 16rpx;
.delete-price {
text-decoration: line-through;
flex: 1;
.unit {
margin-right: 6rpx;
}
}
&>view {
line-height: 1;
&:nth-child(2) {
text-align: right;
}
}
}
.member-price-tag {
display: inline-block;
width: 60rpx;
line-height: 1;
margin-left: 6rpx;
image {
width: 100%;
}
}
}
}
// 商品列表双列样式
.goods-list.double-column {
display: flex;
flex-wrap: wrap;
margin: 0 $margin-both;
padding-top: $margin-updown;
.goods-item {
flex: 1;
position: relative;
background-color: #fff;
flex-basis: 48%;
max-width: calc((100% - 30rpx) / 2);
margin: 0 $margin-both $margin-updown 0;
border-radius: $border-radius;
&:nth-child(2n) {
margin-right: 0;
}
.goods-img {
position: relative;
overflow: hidden;
padding-top: 100%;
border-top-left-radius: $border-radius;
border-top-right-radius: $border-radius;
image {
width: 100%;
position: absolute;
top: 50%;
left: 0;
transform: translateY(-50%);
}
}
.goods-tag {
color: #fff;
line-height: 1;
padding: 8rpx 16rpx;
position: absolute;
border-bottom-right-radius: $border-radius;
top: 0;
left: 0;
font-size: $font-size-goods-tag;
}
.goods-tag-img {
position: absolute;
border-top-left-radius: $border-radius;
width: 80rpx;
height: 80rpx;
top: 0;
left: 0;
z-index: 5;
overflow: hidden;
image {
width: 100%;
height: 100%;
}
}
.info-wrap {
padding: 0 26rpx 26rpx 26rpx;
}
.goods-name {
font-size: $font-size-base;
line-height: 1.3;
overflow: hidden;
text-overflow: ellipsis;
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
margin-top: 20rpx;
height: 68rpx;
}
.discount-price {
display: inline-block;
font-weight: bold;
line-height: 1;
margin-top: 16rpx;
color: var(--price-color);
.unit {
margin-right: 6rpx;
}
}
.pro-info {
display: flex;
margin-top: 16rpx;
.delete-price {
text-decoration: line-through;
flex: 1;
.unit {
margin-right: 6rpx;
}
}
&>view {
line-height: 1;
&:nth-child(2) {
text-align: right;
}
}
}
.member-price-tag {
display: inline-block;
width: 60rpx;
line-height: 1;
margin-left: 6rpx;
image {
width: 100%;
}
}
}
}
</style>
<style scoped>
>>>.uni-tag--primary.uni-tag--inverted {
background-color: #f5f5f5 !important;
}
</style>

View File

@@ -0,0 +1,593 @@
<template>
<view class="conteiner" :style="themeColor">
<!-- #ifdef MP-WEIXIN -->
<view class="point-navbar"
:style="{'padding-top': menuButtonBounding.top + 'px', height: menuButtonBounding.height + 'px' }">
<view class="nav-wrap" :style="{width: menuButtonBounding.left + 'px'}">
<view class="back" @click="back" :style="{width: menuButtonBounding.height + 'px', height: menuButtonBounding.height + 'px' }">
<text class="iconfont icon-back_light"></text>
</view>
<view class="search" @click="$util.redirectTo('/pages_tool/goods/search')">
<text class="iconfont icon-sousuo3"></text>
<text class="tips">搜索商品</text>
</view>
<view class="sign" :style="{width: menuButtonBounding.height + 'px', height: menuButtonBounding.height + 'px' }" @click="redirect('/pages_tool/member/signin')">
<image :src="$util.img('public/uniapp/point/navbar-sing-icon.png')" mode="widthFix"></image>
</view>
</view>
</view>
<view class="point-navbar-block" :style="{ height: menuButtonBounding.bottom + 'px' }"></view>
<!-- #endif -->
<scroll-view scroll-y="true" class="point-scroll-view" @scrolltolower="getData">
<view class="point-wrap" :style="{'background-position-y': -menuButtonBounding.bottom + 'px'}">
<view class="head-box">
<view class="account-content">
<view class="left">
<image :src="$util.img('public/uniapp/point/point-icon.png')" mode="widthFix"></image>
<view>我的积分</view>
</view>
<view class="right">
<text class="point price-font">{{point}}</text>
<text class="text">积分</text>
<!-- <text class="iconfont icon-right"></text> -->
</view>
</view>
<view class="remark">
<view class="label">提醒</view>
<view class="text">积分兑好礼每日上新换不停</view>
</view>
</view>
<!-- <view class="menu-wrap">
<view class="menu-list">
<view class="menu-item" @click="openPointPopup()">
<image :src="$util.img('/public/uniapp/point/point-rule.png')" class="menu-img"></image>
<image :src="$util.img('/public/uniapp/point/must-see.png')" class="menu-tag"></image>
<view class="title">活动规则</view>
</view>
<view class="menu-item" @click="redirect('/pages_tool/recharge/list')">
<image :src="$util.img('/public/uniapp/point/recharge.png')" class="menu-img"></image>
<image :src="$util.img('/public/uniapp/point/high.png')" class="menu-tag"></image>
<view class="title">储值赚积分</view>
</view>
<view class="menu-item" @click="redirect('/pages_promotion/point/order_list')">
<image :src="$util.img('/public/uniapp/point/exchange-record.png')" class="menu-img"></image>
<view class="title">兑换记录</view>
</view>
<view class="menu-item" @click="luckdraw">
<image :src="$util.img('/public/uniapp/point/luck-draw.png')" class="menu-img"></image>
<view class="title">积分抽奖</view>
</view>
<view class="menu-item" @click="redirect('/pages_tool/member/point_detail')">
<image :src="$util.img('/public/uniapp/point/point-detail.png')" class="menu-img"></image>
<view class="title">积分明细</view>
</view>
</view>
</view> -->
<!--
<view class="poster-wrap">
<view class="poster-item" @click="redirect('/pages_tool/recharge/list')">
<image :src="$util.img('/public/uniapp/point/recharge-poster.png')" mode="widthFix"></image>
</view>
<view class="poster-item" @click="luckdraw">
<image :src="$util.img('/public/uniapp/point/luck-draw-poster.png')" mode="widthFix"></image>
</view>
</view> -->
<view class="recharge-list-wrap" @click="redirect('/pages_tool/recharge/list')" v-if="rechargeList.length">
<view class="item-wrap" v-for="(item, index) in rechargeList.slice(0, 4)" :key="index">
<view class="recharge">储值{{ parseFloat(item.buy_price) }}</view>
<view class="point">可得{{ item.point }}积分</view>
<view class="btn">去储值</view>
</view>
</view>
<view class="body-wrap" :class="{ 'no-login': !storeToken }">
<view class="point-exchange-wrap exchange-coupon" v-if="couponList.length > 0">
<view class="card-category-title">
<text class="before-line"></text>
<text>积分换券</text>
<text class="after-line"></text>
</view>
<view class="list-wrap">
<view class="list-wrap-scroll" :class="{'single-row': couponList.length < 3}">
<view class="list-wrap-item coupon-list-wrap-item" v-for="(couponItem, couponIndex) in couponList" :key="couponIndex" @click="toDetail(couponItem)">
<view class="img-box">
<image :src="$util.img('public/uniapp/point/coupon_' + themeStyle.name + '_bg1.png')"/>
</view>
<view class="content">
<view class="coupon"
:style="{ backgroundImage: 'url(' + $util.img('public/uniapp/point/coupon_theme-blue_bg1.jpg') + ')' }">
<view class="coupon_left color-line-border">
<view class="price price-font">
<block v-if="couponItem.coupon_type == 'reward'">
<text></text>
{{ parseFloat(couponItem.money) }}
</block>
<block v-if="couponItem.coupon_type == 'discount'">
<block v-if="couponItem.coupon_type == 'discount'">
{{ parseFloat(couponItem.discount) }}<text></text>
</block>
</block>
</view>
<view class="coupon-info">
<view class="coupon_condition font-size-activity-tag">
{{ couponItem.at_least == 0 ? '无门槛优惠券' : '满' + parseFloat(couponItem.at_least).toFixed(0) + '可用' }}
</view>
<view class="coupon_type font-size-activity-tag" v-if="couponItem.goods_type == 1">全场券</view>
<view class="coupon_type font-size-activity-tag" v-else-if="couponItem.goods_type == 2||couponItem.goods_type == 3">指定券</view>
</view>
</view>
<view class="coupon_right">
<view class="coupon_num font-size-tag">{{ couponItem.point }}积分</view>
<view class="coupon_btn">兑换</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="point-exchange-wrap exchange-hongbao" v-if="hongbaoList.length > 0">
<view class="card-category-title">
<text class="before-line"></text>
<text>积分换红包</text>
<text class="after-line"></text>
</view>
<view class="list-wrap">
<view class="list-wrap-item hongbao-list-wrap-item" v-for="(hongbaoItem, hongbaoIndex) in hongbaoList" :key="hongbaoIndex" @click="toDetail(hongbaoItem)">
<view class="img-box">
<image :src="$util.img('public/uniapp/point/hongbao_bg.png')"></image>
</view>
<view class="content">
<view class="coupon hongbao">
<view class="coupon_left">
<view class="price price-font">
<text></text>
{{ parseFloat(hongbaoItem.balance).toFixed(0) }}
</view>
<!-- <view class="coupon_condition font-size-activity-tag">{{ hongbaoItem.name }}</view> -->
</view>
<view class="coupon_right">
<view class="coupon_num font-size-tag">{{ hongbaoItem.point }}积分</view>
<view class="coupon_btn">兑换</view>
</view>
</view>
</view>
</view>
</view>
</view>
<view class="point-exchange-wrap" v-if="goodsList.length > 0">
<view class="card-category-title">
<text class="before-line"></text>
<text>积分换礼品</text>
<text class="after-line"></text>
</view>
<view class="list-wrap">
<view class="goods-list double-column" v-if="goodsList.length">
<view class="goods-item " v-for="(item, index) in goodsList" :key="index">
<view class="goods-img" @click="toDetail(item)">
<image :src="goodsImg(item)" mode="widthFix" @error="imgError(index)"></image>
</view>
<view class="info-wrap">
<view class="name-wrap">
<view class="goods-name" @click="toDetail(item)">{{ item.name }}</view>
</view>
<view class="lineheight-clear">
<view class="discount-price">
<view>
<text class="unit price-font point">{{ item.point }}</text>
<text class="unit font-size-tag ">积分</text>
</view>
<block v-if="item.price > 0 && item.pay_type > 0">
<text class="unit font-size-tag">+</text>
<view>
<text class="font-size-tag">{{ parseFloat(item.price).toFixed(2).split(".")[0] }}</text>
<text class="unit font-size-tag">.{{ parseFloat(item.price).toFixed(2).split(".")[1] }}</text>
</view>
</block>
</view>
<view class="btn" @click="toDetail(item)">兑换</view>
</view>
<view class="pro-info" v-if="item.stock_show || item.sale_show ">
<view class="font-size-activity-tag color-tip" v-if="item.stock_show ">
库存:{{ isNaN(parseInt(item.stock)) ? 0 : parseInt(item.stock) }}</view>
<view class="font-size-activity-tag color-tip sale" v-if="item.sale_show ">
已兑:{{ isNaN(parseInt(item.sale_num)) ? 0 : parseInt(item.sale_num) }}
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</view>
</scroll-view>
<!-- 弹出规则 -->
<view @touchmove.prevent.stop>
<uni-popup ref="pointPopup" type="bottom">
<view class="tips-layer">
<view class="head" @click="closePointPopup()">
<view class="title">{{ isEnEnv ? 'Integral Description' : '积分说明'}}</view>
<text class="iconfont icon-close"></text>
</view>
<view class="body">
<view class="detail margin-bottom">
<view class="tip">{{ isEnEnv ? 'Integral Acquisition' : '积分的获取'}}</view>
<view class="font-size-base">1积分可在注册签到分享消费充值时获得</view>
<view class="font-size-base">2在购买部分商品时可获得积分</view>
<view class="tip">{{ isEnEnv ? 'Integral Use' : '积分的使用'}}</view>
<view class="font-size-base">1积分可用于兑换积分中心的商品</view>
<view class="font-size-base">2积分可在参与某些活动时使用</view>
<view class="font-size-base">3积分不得转让出售不设有效期</view>
<view class="tip">{{ isEnEnv ? 'Integral Query' : '积分的查询'}}</view>
<view class="font-size-base">1积分可在会员中心中查询具体数额以及明细</view>
</view>
</view>
</view>
</uni-popup>
</view>
<loading-cover ref="loadingCover"></loading-cover>
<ns-login ref="login"></ns-login>
<!-- #ifdef MP-WEIXIN -->
<!-- 小程序隐私协议 -->
<privacy-popup ref="privacyPopup"></privacy-popup>
<!-- #endif -->
</view>
</template>
<script>
import uniPopup from '@/components/uni-popup/uni-popup.vue';
export default {
components: {
uniPopup
},
data() {
return {
mescroll: {
num: 0,
total: 1,
loading: false
},
categoryList: [{
id: 1,
name: '积分换好物'
},
{
id: 2,
name: '积分换券'
},
{
id: 3,
name: '积分换红包'
}
],
isLogin: false,
goodsList: [],
couponList: [],
hongbaoList: [],
point: 0,
signState: 1, // 签到是否开启
mpShareData: null, //小程序分享数据
menuButtonBounding: {
bottom: 0
},
rechargeList: [], //充值套餐
newestGame: null
};
},
onLoad(option) {
setTimeout( () => {
if (!this.addonIsExist.pointexchange) {
this.$util.showToast({
title: '商家未开启积分商城',
mask: true,
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index');
}, 2000);
}
},1000);
// #ifdef MP-WEIXIN
this.menuButtonBounding = uni.getMenuButtonBoundingClientRect();
// #endif
//小程序分享接收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);
});
}
}
this.getData();
this.getRechargeList();
this.getNewestGame();
},
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
if (this.storeToken) this.getAccountInfo();
this.getCouponList();
this.getHongbaoList();
// this.getSignState();
},
methods: {
// 签到是否开启
getSignState() {
this.$api.sendRequest({
url: '/api/membersignin/getSignStatus',
success: res => {
if (res.code == 0) {
this.signState = res.data.is_use;
}
}
});
},
jumpPage(url) {
this.$util.redirectTo(url);
},
// 打开积分说明弹出层
openPointPopup() {
this.$refs.pointPopup.open();
},
// 打开积分说明弹出层
closePointPopup() {
this.$refs.pointPopup.close();
},
// 优惠券
getCouponList() {
this.$api.sendRequest({
url: '/pointexchange/api/goods/page',
data: {
page_size: 0,
type: 2
},
success: res => {
if (res.code == 0 && res.data) {
this.couponList = res.data.list;
} else {
this.$util.showToast({
title: res.message
});
}
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
//联网失败的回调
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
// 红包
getHongbaoList() {
this.$api.sendRequest({
url: '/pointexchange/api/goods/page',
data: {
page_size: 0,
type: 3
},
success: res => {
if (res.code == 0 && res.data) {
this.hongbaoList = res.data.list;
} else {
this.$util.showToast({
title: res.message
});
}
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
//联网失败的回调
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
//获取积分商品详情
getData() {
if (this.mescroll.loading || this.mescroll.num >= this.mescroll.total) return;
this.mescroll.loading = true;
this.$api.sendRequest({
url: '/pointexchange/api/goods/page',
data: {
page: this.mescroll.num + 1,
page_size: 10,
type: 1
},
success: res => {
let newArr = [];
let msg = res.message;
if (res.code == 0 && res.data) {
newArr = res.data.list;
} else {
this.$util.showToast({
title: msg
});
}
//设置列表数据
this.mescroll.loading = false;
this.mescroll.total = res.data.page_count;
this.mescroll.num += 1;
if (this.mescroll.num == 1) this.goodsList = []; //如果是第一页需手动制空列表
this.goodsList = this.goodsList.concat(newArr); //追加新数据
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
},
fail() {
this.mescroll.loading = false;
//联网失败的回调
if (this.$refs.loadingCover) this.$refs.loadingCover.hide();
}
});
},
//跳转至详情页面
toDetail(item) {
this.$util.redirectTo('/pages_promotion/point/detail', {
id: item.id
});
},
goGoodsList() {
this.$util.redirectTo('/pages_promotion/point/goods_list');
},
//获取个人
getAccountInfo() {
this.$api.sendRequest({
url: '/api/memberaccount/info',
data: {
account_type: 'point'
},
success: res => {
if (res.code == 0 && res.data) {
if (!isNaN(parseFloat(res.data.point))) {
this.point = parseFloat(res.data.point).toFixed(0);
}
} else {
this.$util.showToast({
title: res.message
});
}
}
});
},
//跳转至登录页面
login() {
this.$refs.login.open('/pages_promotion/point/list');
},
imgError(index) {
this.goodsList[index].image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
},
goodsImg(data) {
let img = '';
switch (data.type) {
case 1:
img = this.$util.img(data.image.split(',')[0], {
size: 'mid'
});
break;
case 2:
img = data.image ? this.$util.img(data.image) : this.$util.img(
'public/uniapp/point/coupon.png');
break;
case 3:
img = data.image ? this.$util.img(data.image) : this.$util.img(
'public/uniapp/point/hongbao.png');
break;
}
return img;
},
/**
* 跳转
* @param {Object} url
*/
redirect(url) {
if (!this.storeToken) {
this.$refs.login.open(url);
} else {
this.$util.redirectTo(url);
}
},
getRechargeList() {
this.$api.sendRequest({
url: '/memberrecharge/api/memberrecharge/page',
data: {
page_size: 100,
page: 1
},
success: res => {
if (res.code == 0 && res.data) {
let rechargeList = [];
res.data.list.forEach(item => {
if (item.point > 0) rechargeList.push(item)
});
this.rechargeList = rechargeList;
}
}
})
},
back() {
if (getCurrentPages().length > 1) uni.navigateBack({
delta: 1
});
else this.$util.redirectTo('/pages/index/index');
},
getNewestGame() {
this.$api.sendRequest({
url: '/api/game/newestgame',
success: res => {
if (res.code == 0 && res.data) this.newestGame = res.data;
}
})
},
luckdraw() {
if (this.newestGame) {
switch (this.newestGame.game_type) {
case 'cards':
this.$util.redirectTo('/pages_promotion/game/cards', {
id: this.newestGame.game_id
});
break;
case 'egg':
this.$util.redirectTo('/pages_promotion/game/smash_eggs', {
id: this.newestGame.game_id
});
break;
case 'turntable':
this.$util.redirectTo('/pages_promotion/game/turntable', {
id: this.newestGame.game_id
});
break;
}
} else {
this.$util.showToast({
title: '暂无相关活动'
});
}
}
},
//分享给好友
onShareAppMessage() {
return this.mpShareData.appMessage;
},
//分享到朋友圈
onShareTimeline() {
return this.mpShareData.timeLine;
}
};
</script>
<style lang="scss">
@import './public/css/list.scss';
</style>
<style>
.ns-adv>>>image {
width: 100%;
border-radius: 0;
}
</style>

View File

@@ -0,0 +1,591 @@
<template>
<view class="order-container" :style="themeColor">
<view class="order-nav" v-if="storeToken">
<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="statusItem.status == orderStatus ? 'uni-tab-item-title-active color-base-text' : ''">
{{ statusItem.name }}
</text>
</view>
</view>
<mescroll-uni ref="mescroll" @getData="getListData" top="80rpx" >
<block slot="list">
<block v-if="orderList.length">
<view class="order-item" v-for="(orderItem, orderIndex) in orderList" :key="orderIndex" @click="detail(orderItem)">
<view class="order-header">
<text class="order-no">订单号{{ orderItem.order_no }}</text>
<text class="status-name">
{{ orderItem.order_status == 0 ? '待支付' : orderItem.order_status == 1 ? '已完成' : orderItem.order_status == -1 ? '已关闭' : '' }}
</text>
</view>
<view class="order-body">
<view class="goods-wrap">
<view class="goods-img">
<block v-if="orderItem.type == 2">
<image :src="$util.img(orderItem.exchange_image) ? $util.img(orderItem.exchange_image) : $util.img('public/uniapp/point/coupon.png')"
@error="imageError(orderIndex)" mode="aspectFill" :lazy-load="true"></image>
</block>
<block v-else-if="orderItem.type == 3">
<image :src="$util.img(orderItem.exchange_image) ? $util.img(orderItem.exchange_image) : $util.img('public/uniapp/point/hongbao.png')"
@error="imageError(orderIndex)" mode="aspectFill" :lazy-load="true"></image>
</block>
<block v-else>
<image :src="$util.img(orderItem.exchange_image)" @error="imageError(orderIndex)" mode="aspectFill" :lazy-load="true"></image>
</block>
</view>
<view class="goods-info">
<view class="pro-info">
<view class="goods-name">{{ orderItem.exchange_name }}</view>
<view class="goods-sub-section">
<text class="goods-price">
<text class="price-style large">{{ orderItem.point }}</text>
<text class="unit price-style small">积分</text>
<block v-if="orderItem.price > 0">
+
<text class="unit price-style small">{{ $lang('common.currencySymbol') }}</text>
<text class="price-style large">{{ parseFloat(orderItem.price).toFixed(2).split(".")[0] }}</text>
<text class="unit price-style small">.{{ parseFloat(orderItem.price).toFixed(2).split(".")[1] }}</text>
</block>
</text>
<text class="goods-num">
<text class="iconfont icon-close"></text>
{{ orderItem.num }}
</text>
</view>
</view>
</view>
</view>
</view>
<view class="order-footer">
<view class="order-action" v-if="orderItem.order_status == 0 && orderItem.type == 1">
<view class="order-box-btn font-size-tag" @click.stop="orderClose(orderItem.order_id, orderIndex)">关闭</view>
<view class="order-box-btn color-base-bg color-base-border" @click.stop="openChoosePayment(orderItem.out_trade_no, orderItem.price)">支付</view>
</view>
<view class="order-action" v-else>
<view class="order-box-btn font-size-tag">查看详情</view>
</view>
</view>
</view>
</block>
<block v-if="showEmpty && !orderList.length">
<view class="cart-empty">
<ns-empty :isIndex="true" :emptyBtn ="{url: '/pages_promotion/point/list',text: '去逛逛'}" text="暂无积分兑换订单"></ns-empty>
</view>
</block>
</block>
</mescroll-uni>
<!-- 选择支付方式弹窗 -->
<ns-payment ref="choosePaymentPopup" :payMoney="payMoney" @confirm="orderPay"></ns-payment>
<loading-cover ref="loadingCover"></loading-cover>
<ns-login ref="login"></ns-login>
</view>
</template>
<script>
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
MescrollUni,
nsLogin,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
data() {
return {
orderList: [],
showEmpty: false,
outTradeNo: '',
payMoney: 0,
statusList: [
{status: 'all', id: 'all', name: '全部'},
{status: 0, id: 'pay', name: '待支付'},
{status: 1, id: 'complete', name: '已完成'},
],
orderStatus: 'all',
};
},
onLoad() {
setTimeout( () => {
if (!this.addonIsExist.pointexchange) {
this.$util.showToast({
title: '商家未开启积分商城',
mask: true,
duration: 2000
});
setTimeout(() => {
this.$util.redirectTo('/pages/index/index', {}, 'redirectTo');
}, 2000);
}
},1000);
if (!this.storeToken) {
this.$nextTick(() => {
this.$refs.login.open('/pages_promotion/point/order_list');
});
}
},
onShow() {
if (this.$refs.mescroll) this.$refs.mescroll.refresh();
},
watch: {
storeToken: function(nVal, oVal) {
if (nVal) {
this.$refs.mescroll.refresh();
}
}
},
methods: {
ontabtap(e) {
let index = e.target.dataset.current || e.currentTarget.dataset.current;
this.orderStatus = this.statusList[index].status;
this.$refs.loadingCover.show();
this.$refs.mescroll.refresh();
},
getListData(mescroll) {
this.showEmpty = false;
this.$api.sendRequest({
url: '/pointexchange/api/order/page',
data: {
page: mescroll.num,
page_size: mescroll.size,
order_status: this.orderStatus
},
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.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();
}
});
},
orderClose(order_id, index) {
uni.showModal({
title: '提示',
content: '确定关闭此次兑换?',
success: res => {
if (res.confirm) {
this.$api.sendRequest({
url: '/pointexchange/api/order/close',
data: {
order_id: order_id
},
success: res => {
if (res.code >= 0) {
this.orderList[index].order_status = -1;
this.$util.showToast({
title: '关闭成功'
});
this.$forceUpdate();
}
}
});
}
}
});
},
// 显示选择支付方式弹框
openChoosePayment(out_trade_no, price) {
this.outTradeNo = out_trade_no;
this.payMoney = parseFloat(price);
this.$refs.choosePaymentPopup.open();
},
orderPay() {
this.$refs.choosePaymentPopup.getPayInfo(this.outTradeNo);
},
detail(item) {
if (item.type == 1 && item.relate_order_id) {
switch (item.delivery_type) {
case 'store':
this.$util.redirectTo('/pages_order/detail_pickup', {
order_id: item.relate_order_id
});
break;
case 'local':
this.$util.redirectTo('/pages_order/detail_local_delivery', {
order_id: item.relate_order_id
});
break;
case 'express':
this.$util.redirectTo('/pages_order/detail', {
order_id: item.relate_order_id
});
break;
default:
this.$util.redirectTo('/pages_tool/order/detail_virtual', {
order_id: item.relate_order_id
});
}
} else {
this.$util.redirectTo('/pages_order/detail_point', {
order_id: item.order_id
});
}
},
imageError(index) {
this.orderList[index].exchange_image = this.$util.getDefaultImage().goods;
this.$forceUpdate();
}
}
};
</script>
<style lang="scss" scoped>
/deep/ .fixed {
position: relative;
top: 0;
}
/deep/ .empty {
padding-top: 0 !important;
}
.order-container {
width: 100vw;
height: 100vh;
}
.align-right {
text-align: right;
}
.order-item {
margin: $margin-updown 24rpx;
border-radius: 12rpx;
background: #fff;
position: relative;
.order-header {
display: flex;
align-items: center;
position: relative;
padding: $padding 24rpx 26rpx 24rpx;
&.waitpay {
padding-left: 70rpx;
.iconyuan_checked,
.iconyuan_checkbox {
font-size: $font-size-toolbar;
position: absolute;
top: 48%;
left: 20rpx;
transform: translateY(-50%);
}
.iconyuan_checkbox {
color: $color-tip;
}
}
.icondianpu {
display: inline-block;
line-height: 1;
margin-right: 12rpx;
font-size: $font-size-base;
}
.order-no {
font-size: 26rpx;
}
.status-name {
flex: 1;
text-align: right;
font-size: 26rpx;
font-weight: 600;
}
}
.order-body {
.goods-wrap {
display: flex;
position: relative;
padding: 0 24rpx 30rpx 24rpx;
&:last-of-type {
margin-bottom: 0;
}
.goods-img {
width: 160rpx;
height: 160rpx;
margin-right: 20rpx;
image {
width: 100%;
height: 100%;
border-radius: $border-radius;
}
}
.goods-info {
flex: 1;
position: relative;
max-width: calc(100% - 180rpx);
display: flex;
flex-direction: column;
.pro-info {
flex: 1;
}
.goods-name {
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
line-height: 1.5;
font-size: $font-size-base;
color: $color-title;
}
.goods-sub-section {
width: 100%;
line-height: 1.3;
display: flex;
margin-top: 14rpx;
.goods-price {
font-size: $font-size-tag;
color: var(--price-color);
flex: 1;
font-weight: bold;
}
.goods-num {
font-size: $font-size-tag;
color: $color-tip;
flex: 1;
text-align: right;
line-height: 1;
.iconfont {
font-size: $font-size-tag;
}
}
.goods-type {
font-size: $font-size-tag;
}
.unit {
font-size: $font-size-tag;
margin-right: 2rpx;
}
view {
flex: 1;
line-height: 1.3;
display: flex;
flex-direction: column;
&:last-of-type {
text-align: right;
.iconfont {
line-height: 1;
font-size: $font-size-tag;
}
}
}
}
.goods-action {
text-align: right;
.action-btn {
line-height: 1;
padding: 14rpx 20rpx;
color: $color-title;
display: inline-block;
border-radius: $border-radius;
background: #fff;
border: 2rpx solid #999;
font-size: $font-size-tag;
margin-left: 10rpx;
}
}
}
}
.multi-order-goods {
width: calc(100vw - 96rpx);
white-space: nowrap;
margin: 0 24rpx 30rpx 24rpx!important;
position: relative;
.scroll-view {
width: 100%;
}
.goods-wrap {
padding: 0;
}
.goods-img {
min-width: 160rpx;
}
.shade {
position: absolute;
z-index: 5;
height: 100%;
width: 44rpx;
right: 0;
top: 0;
image {
width: 100%;
height: 100%;
}
}
}
}
.order-footer {
.order-base-info {
.total {
padding: $padding;
font-size: $font-size-tag;
background: rgba(248, 248, 248, 0.5);
display: flex;
margin: 0 24rpx;
& > text {
flex: 1;
line-height: 1;
margin-left: 10rpx;
}
}
.order-type {
padding-top: 20rpx;
flex: 0.5;
& > text {
line-height: 1;
}
}
}
.order-action {
text-align: right;
padding: 30rpx 24rpx;
position: relative;
.order-time {
position: absolute;
top: 35rpx;
left: 30rpx;
display: flex;
align-items: center;
font-size: 10px;
color:#b5b6b9;
image {
width: 26rpx;
height: 26rpx;
margin-right: 6rpx;
}
}
.action-btn {
line-height: 1;
padding: 20rpx 26rpx;
color: #333;
display: inline-block;
border-radius: $border-radius;
background: #fff;
border: 2rpx solid #999;
font-size: $font-size-tag;
margin-left: 10rpx;
}
}
}
}
.empty {
padding-top: 200rpx;
text-align: center;
.empty-image {
width: 180rpx;
height: 180rpx;
}
}
.order-nav {
width: 100vw;
height: 80rpx;
flex-direction: row;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
background: #fff;
display: flex;
position: fixed;
left: 0;
z-index: 998;
justify-content: space-around;
border-radius: 0px 0px 24rpx 24rpx;
.uni-tab-item {
width: 120rpx;
text-align: center;
}
.uni-tab-item-title {
display: inline-block;
height: 80rpx;
line-height: 80rpx;
border-bottom: 1px solid #fff;
flex-wrap: nowrap;
/* #ifndef APP-PLUS */
white-space: nowrap;
/* #endif */
text-align: center;
font-size: 30rpx;
position: relative;
}
.uni-tab-item-title-active::after {
content: " ";
display: block;
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 6rpx;
background: linear-gradient(270deg, var(--base-color-light-9) 0%, var(--base-color) 100%);
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
}
</style>

View File

@@ -2,9 +2,9 @@
<view class="order-container" :style="themeColor" :class="{ 'safe-area': isIphoneX }">
<!-- #ifdef MP-WEIXIN -->
<view class="payment-navbar" :style="{
'padding-top': menuButtonBounding.top + 'px',
height: menuButtonBounding.height + 'px'
}">
'padding-top': menuButtonBounding.top + 'px',
height: menuButtonBounding.height + 'px'
}">
<view class="nav-wrap">
<text class="iconfont icon-back_light" @click="back"></text>
<view class="navbar-title">确认订单</view>
@@ -18,12 +18,11 @@
<!-- 选择地址 -->
<template v-if="orderPaymentData.exchange_info.type == 1 && orderPaymentData.is_virtual == 0">
<!-- 配送方式 -->
<view class="delivery-mode"
v-if="orderCreateData.delivery && orderPaymentData.delivery.express_type.length > 1">
<view class="delivery-mode" v-if="orderCreateData.delivery &&orderPaymentData.delivery.express_type.length > 1">
<view class="action">
<view v-for="(deliveryItem, deliveryIndex) in orderPaymentData.delivery.express_type"
:key="deliveryIndex"
:class="{ active: deliveryItem.name == orderCreateData.delivery.delivery_type }"
:class="{active: deliveryItem.name == orderCreateData.delivery.delivery_type}"
@click="selectDeliveryType(deliveryItem)">
{{ deliveryItem.title }}
<!-- 外圆角 -->
@@ -32,12 +31,10 @@
</view>
</view>
<view class="address-box"
:class="{ 'not-delivery-type': orderPaymentData.delivery.express_type.length <= 1 }"
<view class="address-box" :class="{'not-delivery-type': orderPaymentData.delivery.express_type.length <= 1}"
v-if="orderPaymentData.delivery.delivery_type != 'store'">
<block v-if="storeInfo.storeList.length > 1 && orderPaymentData.delivery.delivery_type == 'local'">
<view class="local-delivery-store" v-if="Object.keys(storeInfo.currStore).length"
@click="$refs.deliveryPopup.open()">
<view class="local-delivery-store" v-if="Object.keys(storeInfo.currStore).length" @click="$refs.deliveryPopup.open()">
<view class="info">
<text class="store-name">{{ storeInfo.currStore.store_name }}</text> 提供配送
</view>
@@ -52,19 +49,14 @@
</view>
</view>
</block>
<view class="info-wrap" :class="{ 'local': orderPaymentData.delivery.delivery_type == 'local' }"
v-if="orderCreateData.member_address" @click="selectAddress">
<view class="info-wrap" :class="{'local': orderPaymentData.delivery.delivery_type == 'local'}" v-if="orderCreateData.member_address" @click="selectAddress">
<view class="content">
<text class="name font-size-base">{{ orderCreateData.member_address.name ?
orderCreateData.member_address.name : '' }}</text>
<text class="font-size-base mobile">{{ orderCreateData.member_address.mobile ?
orderCreateData.member_address.mobile : '' }}</text>
<text class="name font-size-base">{{ orderCreateData.member_address.name ? orderCreateData.member_address.name : '' }}</text>
<text class="font-size-base mobile">{{ orderCreateData.member_address.mobile ? orderCreateData.member_address.mobile : '' }}</text>
<text class="cell-more iconfont icon-right"></text>
<view class="desc-wrap">
{{ orderCreateData.member_address.full_address ?
orderCreateData.member_address.full_address : '' }}
{{ orderCreateData.member_address.address ? orderCreateData.member_address.address : ''
}}
{{ orderCreateData.member_address.full_address ? orderCreateData.member_address.full_address : '' }}
{{ orderCreateData.member_address.address ? orderCreateData.member_address.address : '' }}
</view>
</view>
</view>
@@ -77,14 +69,11 @@
<!-- 外卖配送 -->
<block v-if="orderPaymentData.delivery.delivery_type == 'local'">
<view class="local-box"
v-if="orderPaymentData.config.local.is_use && orderPaymentData.delivery.local.info && orderPaymentData.delivery.local.info.time_is_open == 1">
<view class="local-box" v-if="orderPaymentData.config.local.is_use && orderPaymentData.delivery.local.info && orderPaymentData.delivery.local.info.time_is_open == 1">
<view class="pick-block" @click="localtime">
<view class="font-size-base">送达时间</view>
<view class="time-picker">
<text :class="{ 'color-tip': !orderCreateData.buyer_ask_delivery_title }">{{
orderCreateData.buyer_ask_delivery_title ?
orderCreateData.buyer_ask_delivery_title : '请选择送达时间' }}</text>
<text :class="{'color-tip': !orderCreateData.buyer_ask_delivery_title}">{{ orderCreateData.buyer_ask_delivery_title ? orderCreateData.buyer_ask_delivery_title : '请选择送达时间' }}</text>
<text class="iconfont icon-right cell-more"></text>
</view>
</view>
@@ -93,9 +82,7 @@
<image class="address-line" :src="$util.img('public/uniapp/order/address-line.png')"></image>
</view>
<view class="store-box"
:class="{ 'not-delivery-type': orderPaymentData.delivery.express_type.length <= 1 }"
v-if="orderPaymentData.delivery.delivery_type == 'store' && storeInfo.currStore">
<view class="store-box" :class="{'not-delivery-type': orderPaymentData.delivery.express_type.length <= 1}" v-if="orderPaymentData.delivery.delivery_type == 'store' && storeInfo.currStore">
<block v-if="storeInfo.currStore">
<view @click="openSiteDelivery" class="store-info">
<view class="store-address-info">
@@ -117,22 +104,20 @@
<view class="mobile-wrap store-mobile">
<view class="form-group">
<text class="text">姓名</text>
<input type="text" placeholder-class="color-tip placeholder" class="input"
v-model="member_address.name" disabled />
<input type="text" placeholder-class="color-tip placeholder" class="input" v-model="member_address.name" disabled />
</view>
</view>
<view class="mobile-wrap store-mobile">
<view class="form-group">
<text class="text">预留手机</text>
<input type="number" maxlength="11" placeholder="请输入您的手机号码"
placeholder-class="color-tip placeholder" class="input"
v-model="member_address.mobile" />
placeholder-class="color-tip placeholder" class="input" v-model="member_address.mobile" />
</view>
</view>
<view class="store-time">
<view class="left">自提时间</view>
<view class="right" @click="storetime">
{{ orderCreateData.buyer_ask_delivery_title }}
{{orderCreateData.buyer_ask_delivery_title}}
<text class="iconfont icon-right"></text>
</view>
</view>
@@ -152,35 +137,27 @@
<view class="form-group">
<text class="iconfont icon-dianhua2"></text>
<text class="text">手机号码</text>
<input type="number" maxlength="11" placeholder="请输入您的手机号码"
placeholder-class="color-tip placeholder" class="input"
v-model="orderCreateData.member_address.mobile" />
<input type="number" maxlength="11" placeholder="请输入您的手机号码" placeholder-class="color-tip placeholder" class="input" v-model="orderCreateData.member_address.mobile" />
</view>
</view>
<!-- 店铺 -->
<view class="site-wrap"
:class="orderPaymentData.exchange_info.type == 2 || orderPaymentData.exchange_info.type == 3 ? 'margin-top' : ''">
<view class="site-wrap" :class="orderPaymentData.exchange_info.type == 2 || orderPaymentData.exchange_info.type == 3 ? 'margin-top' : ''">
<view class="site-body">
<view class="goods-wrap">
<block v-if="orderPaymentData.exchange_info.type == 2">
<view class="goods-img">
<image
:src="orderPaymentData.exchange_info.image ? $util.img(orderPaymentData.exchange_info.image) : $util.img('public/uniapp/point/coupon.png')"
@error="imageError()" mode="aspectFill" />
<image :src="orderPaymentData.exchange_info.image ? $util.img(orderPaymentData.exchange_info.image) : $util.img('public/uniapp/point/coupon.png')" @error="imageError()" mode="aspectFill"/>
</view>
</block>
<block v-else-if="orderPaymentData.exchange_info.type == 3">
<view class="goods-img">
<image
:src="orderPaymentData.exchange_info.image ? $util.img(orderPaymentData.exchange_info.image) : $util.img('public/uniapp/point/hongbao.png')"
@error="imageError()" mode="aspectFill" />
<image :src="orderPaymentData.exchange_info.image ? $util.img(orderPaymentData.exchange_info.image) : $util.img('public/uniapp/point/hongbao.png')" @error="imageError()" mode="aspectFill"/>
</view>
</block>
<block v-else>
<view class="goods-img">
<image :src="$util.img(orderPaymentData.exchange_info.image)" @error="imageError()"
mode="aspectFill" />
<image :src="$util.img(orderPaymentData.exchange_info.image)" @error="imageError()" mode="aspectFill"/>
</view>
</block>
<view class="goods-info">
@@ -205,8 +182,7 @@
<view class="site-footer">
<view class="order-cell">
<text class="tit">买家留言</text>
<view class="box"><input type="text" placeholder="留言前建议先与商家协调一致" placeholder-class="color-tip"
v-model="orderCreateData.buyer_message" /></view>
<view class="box"><input type="text" placeholder="留言前建议先与商家协调一致" placeholder-class="color-tip" v-model="orderCreateData.buyer_message" /></view>
</view>
</view>
</view>
@@ -220,8 +196,7 @@
<text class="unit">积分</text>
</view>
</view>
<view class="order-cell"
v-if="orderPaymentData.exchange_info.type == 1 && orderPaymentData.delivery_money > 0">
<view class="order-cell" v-if="orderPaymentData.exchange_info.type == 1 && orderPaymentData.delivery_money > 0">
<text class="tit">运费</text>
<view class="box">
<text class="unit">{{ $lang('common.currencySymbol') }}</text>
@@ -231,9 +206,8 @@
</view>
<view class="error-message"
v-if="orderPaymentData.delivery && orderPaymentData.delivery.delivery_type == 'local' && orderPaymentData.delivery && orderPaymentData.delivery.error && orderPaymentData.delivery.error !== ''">
{{ orderPaymentData.delivery.error_msg }}
<view class="error-message" v-if="orderPaymentData.delivery && orderPaymentData.delivery.delivery_type == 'local' && orderPaymentData.delivery && orderPaymentData.delivery.error && orderPaymentData.delivery.error !== ''">
{{orderPaymentData.delivery.error_msg}}
</view>
<view class="order-submit" :class="{ 'bottom-safe-area': isIphoneX }">
<view class="order-settlement-info">
@@ -247,14 +221,12 @@
</template>
</view>
<view class="submit-btn">
<button v-if="createBtn()" type="primary" class="mini" size="mini"
@click="openChoosePayment()">提交订单</button>
<button v-if="createBtn()" type="primary" class="mini" size="mini" @click="openChoosePayment()">提交订单</button>
<button v-else class="no-submit mini" size="mini">
<block
v-if="orderPaymentData.delivery && orderPaymentData.delivery.delivery_type == 'local' && orderPaymentData.delivery && orderPaymentData.delivery.error && orderPaymentData.delivery.start_money > orderPaymentData.price">
{{ orderPaymentData.delivery.start_money - orderPaymentData.price | moneyFormat }}起送
<block v-if="orderPaymentData.delivery && orderPaymentData.delivery.delivery_type == 'local' && orderPaymentData.delivery && orderPaymentData.delivery.error && orderPaymentData.delivery.start_money > orderPaymentData.price">
{{ orderPaymentData.delivery.start_money-orderPaymentData.price | moneyFormat }}起送
</block>
<block v-else>提交订单</block>
<block v-else >提交订单</block>
</button>
</view>
</view>
@@ -269,29 +241,22 @@
</view>
<view class="popup-body store-popup" :class="{ 'safe-area': isIphoneX }">
<view class="delivery-content">
<view class="item-wrap" v-for="(item, index) in storeInfo.storeList" :key="index"
@click="selectPickupPoint(item)">
<view class="item-wrap" v-for="(item, index) in storeInfo.storeList" :key="index" @click="selectPickupPoint(item)">
<view class="detail">
<view class="name"
:class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''">
<view class="name" :class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''">
<text>{{ item.store_name }}</text>
<text v-if="item.distance">({{ item.distance }}km)</text>
</view>
<view class="info">
<view
:class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''"
class="font-size-goods-tag">
<view :class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''" class="font-size-goods-tag">
营业时间{{ item.open_date }}
</view>
<view
:class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''"
class="font-size-goods-tag">
<view :class="item.store_id == orderPaymentData.delivery.store_id ? 'color-base-text' : ''" class="font-size-goods-tag">
地址{{ item.full_address }}{{ item.address }}
</view>
</view>
</view>
<view class="icon" v-if="item.store_id == orderPaymentData.delivery.store_id"><text
class="iconfont icon-yuan_checked color-base-text"></text></view>
<view class="icon" v-if="item.store_id == orderPaymentData.delivery.store_id"><text class="iconfont icon-yuan_checked color-base-text"></text></view>
</view>
<view v-if="!storeInfo.storeList" class="empty">所选择收货地址附近没有可以自提的门店</view>
</view>
@@ -302,8 +267,7 @@
</scroll-view>
<!-- 选择支付方式弹窗 -->
<ns-payment ref="choosePaymentPopup" :payMoney="orderPaymentData.order_money"
@confirm="orderCreate"></ns-payment>
<ns-payment ref="choosePaymentPopup" :payMoney="orderPaymentData.order_money" @confirm="orderCreate"></ns-payment>
<loading-cover ref="loadingCover"></loading-cover>
@@ -313,41 +277,48 @@
</template>
<script>
import payment from '@/pages_promotion/point/public/js/payment.js';
import payment from './public/js/payment.js';
import uniPopup from '@/components/uni-popup/uni-popup.vue';
import nsSelectTime from '@/components/ns-select-time/ns-select-time.vue';
import MescrollUni from "@/components/mescroll/my-list-mescroll.vue";
import nsLogin from '@/components/ns-login/ns-login.vue';
import loadingCover from '@/components/loading-cover/loading-cover.vue';
import nsEmpty from '@/components/ns-empty/ns-empty.vue';
// #ifdef MP-WEIXIN
import privacyPopup from '@/components/wx-privacy-popup/privacy-popup.vue';
// #endif
export default {
components: {
uniPopup: () => import('@/components/uni-popup/uni-popup.vue'),
nsSelectTime: () => import('@/components/ns-select-time/ns-select-time.vue'),
nsLogin: () => import('@/components/ns-login/ns-login.vue'),
MescrollUni: () => import('@/components/mescroll/my-list-mescroll.vue'),
loadingCover: () => import('@/components/loading-cover/loading-cover.vue'),
nsEmpty: () => import('@/components/ns-empty/ns-empty.vue'),
nsPayment: () => import('@/components/payment/payment.vue'),
// #ifdef MP-WEIXIN
privacyPopup: () => import('@/components/wx-privacy-popup/privacy-popup.vue'),
// #endif
},
mixins: [payment]
};
export default {
components: {
uniPopup,
nsSelectTime,
nsLogin,
MescrollUni,
loadingCover,
nsEmpty,
// #ifdef MP-WEIXIN
privacyPopup
// #endif
},
mixins: [payment]
};
</script>
<style lang="scss">
@import "@/common/css/order_parment.scss";
@import "@/common/css/order_parment.scss";
</style>
<style lang="scss" scoped>
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
/deep/ .uni-popup__wrapper.uni-custom .uni-popup__wrapper-box {
background: none;
max-height: unset !important;
overflow-y: hidden !important;
}
/deep/ .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
/deep/ .uni-popup__wrapper {
border-radius: 20rpx 20rpx 0 0;
}
/deep/ .uni-popup {
z-index: 8;
}
/deep/ .uni-popup {
z-index: 8;
}
</style>

View File

@@ -0,0 +1,92 @@
<template>
<view class="container" :style="themeColor">
<view class="image-wrap">
<image :src="$util.img('public/uniapp/pay/pay_success.png')" class="result-image" mode="widthFix"></image>
</view>
<view class="msg">{{ $lang('exchangeSuccess') }}</view>
<view class="action">
<view class="btn color-base-border color-base-text" @click="toOrderList()">{{ $lang('see') }}</view>
<view class="btn go-home color-base-bg" @click="toIndex">{{ $lang('goHome') }}</view>
</view>
</view>
</template>
<script>
export default {
data() {
return {};
},
onShow() {
},
methods: {
toOrderList() {
this.$util.redirectTo('/pages_promotion/point/order_list', {}, 'redirectTo');
},
toIndex() {
this.$util.redirectTo('/pages/index/index');
}
}
};
</script>
<style lang="scss">
.container {
width: 100vw;
height: 100vh;
background: #fff;
.image-wrap {
display: flex;
justify-content: center;
padding: 200rpx 0 40rpx 0;
.result-image {
width: 166rpx;
}
}
.msg {
text-align: center;
line-height: 1;
margin-bottom: 50rpx;
font-size: $font-size-base;
color: #000;
}
.pay-amount {
color: #999;
text-align: center;
line-height: 1;
margin-bottom: 30rpx;
}
.action {
width: 90%;
margin: 0 auto;
text-align: center;
margin-top: 150rpx;
display: flex;
justify-content: space-between;
.btn {
width: 310rpx;
height: 78rpx;
border: 2rpx solid #ffffff;
border-radius: $border-radius;
font-size: $font-size-tag;
display: flex;
align-items: center;
justify-content: center;
}
.alone {
margin-left: 0;
width: 60%;
}
.go-home {
color: #fff;
}
}
}
</style>