Commit 25acd2b6 by 杨北旺

Merge branch 'v1.0.0' of 192.168.3.233:saas/mini-program/hmd into v1.0.0

2 parents ac23a76b 0bb1366c
Showing 54 changed files with 129 additions and 1406 deletions
......@@ -51,5 +51,6 @@ const getMockData = async () => {
}
module.exports={
getImageVersion
getImageVersion,
getMockData
}
\ No newline at end of file
......@@ -87,7 +87,7 @@ class Request {
query = []
if (options.length) {
options.map(key => {
query.push(`${key}=${options[key]}`)
query.push(`${key}=${thisPage.options[key]}`)
})
}
if (query.length) currentRoute += `?${query.join('&')}`
......
@import "assets/style/common.wxss";
page {
background-color: #F7F7F7;
background-color: #F9F7F7 !important;
color: #282829;
font-size: 28rpx;
--themeColor: #8A303A;
......
// components/Calendar/Calendar.js
import Calendar from './Calendar_Function'
import _component_ from './Static_Properties'
const CalendarFunction = Symbol('CalendarFunction')
// import {componentsMixin } from '../../mixins/index'
Component({
// behaviors:[componentsMixin],
/**
* 组件的属性列表
*/
properties: _component_.properties,
/**
* 组件的初始数据
*/
data: _component_.data,
/**
* 组件的方法列表
*/
methods: {
noScroll() {},
setCalenderBodyHeight() {
this[CalendarFunction].setCalenderBodyHeight()
},
showCalendar(e) {
let type = (e && e.currentTarget && e.currentTarget.dataset.type) || ''
let result = type === 'show'
if (!result) {
this.setData({
hideCalendar: true
})
setTimeout(() => {
this.setData({
show: result,
hideCalendar: false
})
}, 300)
} else {
this.setData({
show: result
})
if (!this.data.calenderBodyHeight) this[CalendarFunction].setCalenderBodyHeight()
}
},
dateChange(e) {
let { current } = e.detail
this.setData({
current
})
},
choose(e) {
let { dateType, minDate, maxDate } = this.data
let { data } = e.currentTarget.dataset
if ((minDate && Date.parse(minDate) > Date.parse(data)) || (maxDate && Date.parse(maxDate) < Date.parse(data))) return
this[CalendarFunction][dateType](e)
},
done() {
let { dateType } = this.data
this[CalendarFunction].done(dateType)
},
changeDate(e) {
let { value } = e.detail
this.setData({
current: value
})
},
showShortcutPicker() {
this.setData({
showShortcut: !this.data.showShortcut
})
},
chooseAll() {
this[CalendarFunction].chooseAll()
}
},
attached() {
this[CalendarFunction] = new Calendar(this)
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class='calender-picker' bindtap="showCalendar" data-type='show'>
<slot></slot>
</view>
<!-- 弹框模式 -->
<view class='calender-box' hidden='{{!show}}' catchtouchmove="noScroll">
<view class='calender-bg' bindtap="showCalendar"></view>
<view class='calender-view {{hasRadius}} {{hideCalendar?"hideCalendar":""}} {{!showConfirm?"isFullSucreen":""}}' style="height:{{height}}">
<view class='calender-header'>
<view class='calender-title' wx:if='{{showTitle}}'>
<block wx:if="{{rangeAll && dateType == 'range'}}">
<view class="calender-all" style="color:{{calenderColor}};" bindtap="chooseAll">全选</view>
</block>
{{title||'日期选择'}}
<view class='calender-close' bindtap="showCalendar">
<image webp src="./images/close.png?v={{img_version}}" class='calender-close-image'></image>
</view>
</view>
<block wx:if='{{showSubTitle}}'>
<picker class='calender-subtitle' bindchange="changeDate" bindcancel='showShortcutPicker' value="{{current}}" range="{{dateList}}" wx:if='{{shortcut}}'>
<view class='calender-subtitle-text' bindtap="showShortcutPicker">
{{dateList[current]}}
<view class='arrow {{showShortcut}}'></view>
</view>
</picker>
<view class='calender-subtitle' wx:else>{{dateList[current]}}</view>
</block>
<view class='calendar-weekdays'>
<block wx:for='{{weekdays}}' wx:key='index'>
<view class='calendar-weekday'>{{item}}</view>
</block>
</view>
</view>
<view class='calender-body' style="height:calc(100% - {{calenderBodyHeight}})">
<swiper class='calender-swiper' bindchange='dateChange' current='{{current}}' vertical='{{vertical}}'>
<block wx:for='{{monthList}}' wx:key='index'>
<swiper-item>
<view class='calender-mark box-center' wx:if="{{!hideMark}}">{{item.mark}}</view>
<view class='calender-month'>
<block wx:for='{{item.data}}' wx:for-item='i' wx:for-index='ind' wx:key='ind'>
<view class='calender-day {{ind == 0?i.week:""}} {{i.active?"active":""}} {{i.disable?"disable":""}}' style="background:{{i.active?calenderColor:''}};color:{{i.middle?calenderColor:''}}" bindtap="choose" data-index='{{index}}' data-ind='{{ind}}' data-data='{{i.data}}'>
<view class='calender-middle' style="background:{{calenderColor}};" wx:if='{{i.middle}}'></view>
<view class='box-center text'>
{{i.day}}
<view wx:if='{{dateType==="range"}}' class='calender-tips'>
<view wx:if='{{i.start}}'>{{rangeText.start}}</view>
<view wx:if='{{i.end}}'>{{rangeText.end}}</view>
</view>
</view>
</view>
</block>
</view>
</swiper-item>
</block>
</swiper>
</view>
<view class='calender-footer isFullSucreen' wx:if='{{showConfirm}}'>
<view class='calender-btn {{dateType === "range" && !rangeDate.end ?"disable":""}} {{dateType === "multiple" && multipleDate.length < 1 ?"disable":""}}' style="background:{{calenderColor}}" bindtap="done">
{{confirmText||'确定'}}
</view>
</view>
</view>
</view>
\ No newline at end of file
/* components/Calendar/Calendar.wxss */
.calender-box {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 99;
}
.calender-bg {
position: absolute;
background: rgba(0, 0, 0, .5);
top: 0;
left: 0;
bottom: 0;
right: 0;
}
.calender-view {
position: absolute;
left: 0;
width: 100%;
background: #fff;
animation: show-calender .5s forwards;
color: #333;
}
.calender-view.true {
border-radius: 40rpx 40rpx 0 0;
}
.calender-view.isFullSucreen {
box-sizing: border-box;
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
@keyframes show-calender {
from {
bottom: -100%;
}
to {
bottom: 0;
}
}
.calender-view.hideCalendar {
animation: hide-calender .5s forwards;
}
@keyframes hide-calender {
from {
bottom: 0;
}
to {
bottom: -100%;
}
}
.calender-header {
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.10);
}
.calender-title,
.calender-subtitle {
width: 100%;
height: 88rpx;
text-align: center;
position: relative;
font-size: 32rpx;
display: flex;
align-items: center;
justify-content: center;
}
.calender-all {
position: absolute;
top: 50%;
left: 24rpx;
transform: translateY(-50%);
font-size: 20rpx;
}
.calender-subtitle-text {
display: flex;
align-items: center;
justify-content: center;
}
.calender-subtitle {
font-size: 28rpx;
}
.calender-subtitle .arrow {
width: 14rpx;
height: 14rpx;
border-top: 2rpx solid transparent;
border-right: 2rpx solid #ccc;
border-bottom: 2rpx solid #ccc;
border-left: 2rpx solid transparent;
transform: rotate(45deg) translateY(-4rpx);
margin-left: 16rpx;
transition: all .3s;
}
.calender-subtitle .arrow.true {
transform: rotate(225deg) translateY(0) translateX(-4rpx);
}
.calender-close {
position: absolute;
width: 40rpx;
height: 40rpx;
top: 50%;
right: 24rpx;
transform: translateY(-50%);
display: flex;
align-items: center;
justify-content: center;
}
.calender-close-image {
width: 24rpx;
height: 24rpx;
}
.calendar-weekdays {
display: grid;
grid-template-columns: repeat(7, 1fr);
font-size: 24rpx;
line-height: 60rpx;
}
.calendar-weekday {
text-align: center;
}
.calender-body {
width: 100%;
padding: 20rpx 0;
box-sizing: border-box;
}
.calender-swiper {
height: 100%;
}
.calender-mark {
color: rgba(0, 0, 0, .1);
text-shadow: 0 4rpx 20rpx rgba(0, 0, 0, .1);
font-size: 320rpx;
width: 100%;
text-align: center;
}
.box-center {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.calender-month {
height: 100%;
position: relative;
z-index: 1;
display: grid;
grid-template-rows: repeat(minmax(5, 6), 1fr);
grid-template-columns: repeat(7, 1fr);
}
.calender-day {
position: relative;
font-size: 32rpx;
display: flex;
}
.calender-day.active {
color: #fff;
border-radius: 8rpx;
}
.calender-day.disable {
opacity: .25;
}
.calender-day .calender-middle {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
opacity: 0.1;
}
.calender-day .text {
text-align: center;
width: 100%;
}
.calender-tips {
font-size: 14rpx;
}
.week-1 {
grid-column-start: 2;
}
.week-2 {
grid-column-start: 3;
}
.week-3 {
grid-column-start: 4;
}
.week-4 {
grid-column-start: 5;
}
.week-5 {
grid-column-start: 6;
}
.week-6 {
grid-column-start: 7;
}
.calender-footer {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
padding: 14rpx 32rpx;
box-sizing: border-box;
}
.calender-footer.true {
padding-bottom: 34px !important;
}
.calender-footer .calender-btn {
width: 100%;
height: 72rpx;
font-size: 28rpx;
color: #fff;
border-radius: 8rpx;
display: flex;
justify-content: center;
align-items: center;
}
.calender-footer .calender-btn.disable {
opacity: .3;
}
\ No newline at end of file
const _CalendarObject_ = Symbol('_CalendarObject_')
const _nowDate_ = Symbol('_nowDate_')
const _separator_ = Symbol('_separator_')
class Calendar {
[_CalendarObject_] = {};
[_nowDate_] = new Date();
[_separator_] = '-'
constructor(calendarObject) {
this[_CalendarObject_] = calendarObject
this[_separator_] = calendarObject.data.separator
this.setCalenderHeight()
this.setMonthList()
let { weekdays, firstDayOfWeek } = calendarObject.data
let firstDay = weekdays[firstDayOfWeek - 1]
let [last, first] = weekdays.join('').split(firstDay)
calendarObject.setData({
weekdays: [firstDay, ...first, ...last]
})
}
/**设置日历高度 */
setCalenderHeight() {
let _this = this[_CalendarObject_]
let { data: calenderHeight } = _this
let height = '80%'
if (typeof calenderHeight === 'number') {
wx.p.api.getSystemInfo(res => {
let { windowHeight } = res
if (calenderHeight > windowHeight) calenderHeight = windowHeight
if (calenderHeight < windowHeight * 0.5) calenderHeight = windowHeight * 0.5
height = `${calenderHeight}px`
})
}
if (typeof calenderHeight === 'string') {
if (calenderHeight.includes('%')) {
height = calenderHeight
let [num] = calenderHeight.split('%')
if (num < 50) height = '50%'
if (num > 100) height = '80%'
} else {
if (calenderHeight < 50) calenderHeight = '50'
if (calenderHeight > 100) calenderHeight = '80'
height = `${calenderHeight}%`
}
}
_this.setData({
height
})
}
/**设置日期高度 */
setCalenderBodyHeight() {
let _this = this[_CalendarObject_]
wx.p.util.getViewInfo(
'.calender-header',
header => {
wx.p.util.getViewInfo(
'.calender-footer',
footer => {
let headerHeight = header.height
let footerHeight = (footer && footer.height) || 0
_this.setData({
calenderBodyHeight: `${headerHeight + footerHeight}px`
})
},
_this
)
},
_this
)
}
/**设置日期列表 */
setMonthList() {
let { separator, previous, minDate, maxDate, next } = this[_CalendarObject_].data
if (maxDate || minDate) {
if (!minDate) {
let nowMonth = new Date().getMonth()
minDate = new Date(new Date().setMonth(nowMonth - previous)).format(`yyyy${separator}MM${separator}dd`)
}
if (!maxDate) {
maxDate = this[_nowDate_].format(`yyyy${separator}MM${separator}dd`)
}
previous = this.getMonthDifference(minDate, this[_nowDate_].format(`yyyy${separator}MM${separator}dd`))
next = this.getMonthDifference(this[_nowDate_].format(`yyyy${separator}MM${separator}dd`), maxDate)
} else {
previous = previous < 0 ? 0 : previous
next = next < 0 ? 0 : next
}
let nowMonth = this[_nowDate_].getMonth()
let now = new Date().setDate(1)
for (let i = nowMonth - previous; i <= nowMonth + next; i++) {
this.init(new Date(now).setMonth(i))
}
}
/**初始化日期 */
init(date) {
let _this = this[_CalendarObject_]
let { firstDayOfWeek, allowSameDay, multipleDate, monthList, rangeDate, dateList, dateType, current, minDate, maxDate, value } = _this.data
let separator = this[_separator_]
let [year, month] = new Date(date).format(`yyyy${separator}MM`).split(separator)
let days = this.getDayNumber(year, Number(month))
let week = new Date(year, Number(month) - 1, 1).getDay()
let dateFormat = `yyyy${separator}MM${separator}dd`
let today = value || this[_nowDate_].format(dateFormat)
let nextDay = ''
let arr = []
dateList.push(`${year}${separator}${month}`)
if (dateType === 'range') {
nextDay = new Date(new Date().setDate(new Date(new Date(today)).getDate() + 1)).format(dateFormat)
}
let [now_year, now_month, now_day] = today.split(separator)
let [next_year, next_month, next_day] = allowSameDay ? today.split(separator) : nextDay.split(separator)
for (let i = 1; i <= days; i++) {
let todayStr = `${year}${separator}${month}${separator}${now_day}`
let dayStr = `${year}${separator}${month}${separator}${i < 10 ? `0${i}` : i}`
let obj = {
day: i,
data: dayStr,
active: now_year == year && now_month == month && i == Number(now_day)
}
if ((minDate && Date.parse(minDate) > Date.parse(dayStr)) || (maxDate && Date.parse(maxDate) < Date.parse(dayStr))) obj.disable = true
if (dateType === 'multiple') multipleDate.push(todayStr)
if (nextDay) {
if (now_year == year && now_month == month && i == Number(now_day)) {
obj.start = true
rangeDate.start = todayStr
}
if (next_year == year && next_month == month && i == Number(next_day)) {
obj.active = true
obj.end = true
rangeDate.end = `${year}${separator}${next_month}${separator}${next_day}`
}
}
firstDayOfWeek = firstDayOfWeek == 7 ? 0 : firstDayOfWeek
if (i === 1) obj.week = `week-${week - firstDayOfWeek}`
arr.push(obj)
}
monthList.push({
data: arr,
mark: Number(month)
})
if (current <= 1) {
let [nowYear, nowMonth] = today.split(separator)
current = dateList.findIndex(e => e === `${nowYear}${separator}${nowMonth}`)
}
_this.setData({
multipleDate,
date: today,
rangeDate,
monthList,
dateList,
current
})
}
/**当设置最小日期或者最大日期时 自动设置前后月份 */
getMonthDifference(date1, date2) {
let separator = this[_separator_]
//获取年,月数
let [year1, month1] = date1.split(separator)
let [year2, month2] = date2.split(separator)
let months = (parseInt(year2) - parseInt(year1)) * 12 + (parseInt(month2) - parseInt(month1))
return months
}
/**单选 */
single(e) {
let _this = this[_CalendarObject_]
let { index, data, ind } = e.currentTarget.dataset
let { showConfirm, monthList } = _this.data
monthList.map(x => {
x.data.map(i => (i.active = false))
})
monthList[index].data[ind].active = true
_this.setData({
monthList,
date: data
})
if (!showConfirm) this.done()
}
/**多选 */
multiple(e) {
let _this = this[_CalendarObject_]
let { index, ind } = e.currentTarget.dataset
let { monthList } = _this.data
let arr = []
monthList[index].data[ind].active = !monthList[index].data[ind].active
monthList.map(x =>
x.data.map(i => {
if (i.active) arr.push(i.data)
})
)
_this.setData({
[`monthList[${index}].data`]: monthList[index].data,
multipleDate: arr
})
}
/**范围选择 */
range(e) {
const _this = this[_CalendarObject_]
let { index, data, ind } = e.currentTarget.dataset
let { allowSameDay, showConfirm, monthList, rangeDate } = _this.data
const start = Date.parse(rangeDate.start)
if (rangeDate.end || start > Date.parse(data)) {
monthList = this.clearStatus({
monthList,
index,
ind
})
rangeDate.start = data
rangeDate.end = ''
} else {
if (!allowSameDay && Date.parse(data) == Date.parse(rangeDate.start)) return
monthList[index].data[ind].active = true
monthList[index].data[ind].end = true
rangeDate.end = data
monthList.map(x => {
x.data.map(i => {
let day = Date.parse(i.data)
i.middle = day > start && day < Date.parse(data)
})
})
}
_this.setData({
monthList,
rangeDate
})
if (!showConfirm && rangeDate.end) this.done()
}
/**点击完成 */
done() {
let _this = this[_CalendarObject_]
let { multipleDate, rangeDate, dateType, date } = _this.data
let targer = {
single: date,
multiple: multipleDate,
range: rangeDate
}
if ((dateType === 'multiple' && multipleDate.length < 1) || (dateType === 'range' && !rangeDate.end)) return
_this.triggerEvent('select', {
date: targer[dateType]
})
_this.showCalendar()
}
/**清空范围选择状态 */
clearStatus(params) {
let { monthList, index, ind } = params
monthList.map(x =>
x.data.map(i => {
i.active = false
i.start = false
i.end = false
i.middle = false
})
)
monthList[index].data[ind].active = true
monthList[index].data[ind].start = true
return monthList
}
/**
* 获取月份天数
*/
getDayNumber(year, month) {
let days = 31
switch (month) {
case 2:
days = (year % 4 == 0 && year % 100 !== 0) || year % 400 == 0 ? 29 : 28
break
case 4:
case 6:
case 9:
case 11:
days = 30
break
}
return days
}
/**日期范围 点击全选 */
chooseAll() {
let _this = this[_CalendarObject_]
let { monthList, minDate, maxDate } = _this.data
monthList.map((e, index) => {
e.data.map((i, ind) => {
let obj = {
currentTarget: {
dataset: {
index,
ind,
data: i.data
}
}
}
if (i.data == minDate) this.range(obj)
if (i.data == maxDate) this.range(obj)
})
})
}
}
export default Calendar
export default {
properties: {
calenderHeight: {
type:String
// type: [String,Number], 企微暂不支持
},
title: String, // 标题名称
hasRadius: {
type: Boolean,
value: true
}, // 是否圆角
showTitle: {
type: Boolean,
value: true
}, // 是否显示标题
showSubTitle: {
type: Boolean,
value: true
}, // 是否显示副标题
confirmText: String, // 确定按钮文本
showConfirm: {
type: Boolean,
value: true
}, // 是否显示确定按钮
calenderColor: {
type: String,
value: '#8A303A'
}, // 日历主题色
previous: {
type: Number,
value: 3
}, // 当前月的前几个月 ,默认3个月
next: {
type: Number,
value: 3
}, // 当前月的后几个月 , 默认3个月
vertical: Boolean, //是否纵向滑动
/** 选择类型默认单选,single 单选, multiple多个日期,range日期范围 */
dateType: {
type: String,
value: 'single'
},
value: String, //单选绑定数据
shortcut: Boolean, //日期快捷切换 默认为false
/** 分隔符,默认为 "-" */
separator: {
type: String,
value: '-'
},
/** 日期范围-开始结束文本 */
rangeText: {
type: Object,
value: {
start: '开始',
end: '结束'
}
},
/**是否显示日期范围 全选 */
rangeAll: Boolean,
/** 是否允许日期范围的起止时间为同一天, 默认为false */
allowSameDay: Boolean,
/** 周起始日,默认周日 */
firstDayOfWeek: {
type: Number,
// type: [Number, String], 企微暂不支持
value: 7
},
/**
* 可选最小日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致。 */
minDate: String,
/** 可选最大日期,不传则默认无限制。
* 格式yyyy-MM-dd, 需跟separator一致 */
maxDate: String,
/**隐藏水印 */
hideMark: Boolean
},
data: {
weekdays: ['一', '二', '三', '四', '五', '六', '日'],
monthList: [],
dateList: [],
current: 0,
height: '80%',
rangeDate: {},
multipleDate: []
}
}
\ No newline at end of file
......@@ -5,7 +5,7 @@
left: 0;
width: 100%;
z-index: 99;
background-color: #fff;
background-color: #F9F7F7;
transition: all .15s;
}
......
// components/SearchBox/SearchBox.js
import {componentsMixin } from '../../mixins/index';
Component({
behaviors: [componentsMixin],
/**
* 组件的属性列表
*/
properties: {
placeholder: {
type: String,
value: "请输入搜索内容",
},
value: {
type: String,
value: "",
observer(n) {
this.setData({
inputValue: n,
});
},
},
searchType: {
type: Number,
value: 1,
},
couponDetails: Boolean,
},
/**
* 组件的初始数据
*/
data: {
inputValue: "",
},
/**
* 组件的方法列表
*/
methods: {
input(e) {
let { value } = e.detail;
this.setData({
inputValue: value,
});
},
blur(e) {
let { inputValue } = this.data;
this.setData({
inputValue,
});
},
clear() {
this.setData({
inputValue: "",
});
},
confirm(e) {
let { value } = e.detail;
this.triggerEvent("search", value);
},
search(e) {
let { value } = e.currentTarget.dataset;
this.triggerEvent("search", value);
},
},
});
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="search-box box-center">
<view class="search type-{{searchType}}">
<view class="input-box" style="{{couponDetails?'width: 528rpx;':''}}">
<view class="icon box-center">
<icon type="search" size="20"></icon>
</view>
<input type="text" bindinput="input" bindblur="blur" value="{{inputValue}}" placeholder-class="input-placeholder" placeholder="{{placeholder}}" confirm-type="search" class="input" bindconfirm="confirm" />
<block wx:if="{{inputValue}}">
<view class="clear-box" bindtap="clear">
<icon type="clear" size="20" class="icon"></icon>
</view>
</block>
</view>
<view class="button box-center" bindtap="search" data-value="{{inputValue}}">搜索</view>
</view>
</view>
\ No newline at end of file
/* components/SearchBox/SearchBox.wxss */
@import '/sprite.wxss';
.search-box {
height: 104rpx;
box-sizing: border-box;
padding: 0 var(--margin);
background-color: #fff;
}
.box-center {
display: flex;
align-items: center;
justify-content: center;
}
.search {
width: 100%;
height: 72rpx;
box-sizing: border-box;
display: flex;
align-items: center;
justify-content: space-between;
}
.type-1 {
padding: 0 6rpx;
border-radius: 38px;
border: 3rpx solid var(--btnColor);
}
.type-1 .button {
width: 104rpx;
height: 60rpx;
border-radius: 38rpx;
background-color: var(--btnColor);
color: #fff;
font-size: var(--margin);
}
.type-1 .input-box {
width: calc(100% - 110rpx);
display: flex;
align-items: center;
}
.input-box .icon {
width: 58rpx;
}
.type-1 .input-box .input,
.type-2 .input-box .input {
width: calc(100% - 130rpx);
font-size: 28rpx;
}
.input-box .clear-box{
width: 58rpx;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
}
.input-box .clear-box .icon-clear{
opacity: .7;
}
.type-2 .input-box {
display: flex;
align-items: center;
width: 592rpx;
height: 100%;
background: #F8F8F8;
border-radius: 38rpx;
}
.type-2 .button {
color: #656566;
font-size: var(--margin);
}
.input-placeholder {
color: #CFCFCF;
font-size: 28rpx;
}
\ No newline at end of file
// components/SearchInput/SearchInput.js
import {componentsMixin } from '../../mixins/index'
Component({
behaviors:[componentsMixin],
/**
* 组件的属性列表
*/
properties: {
maxlength: {
type: Number,
value: -1
},
placeholder: String,
disabled: Boolean,
value: String,
filterEmoji: {
type: Boolean,
value: true
}
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
setValue(value) {
if (this.properties.filterEmoji) {
if (wx.p.util.haveEmoji(value)) value = wx.p.util.replaceEmoji(value)
}
this.setData({
value
})
},
input(e) {
let {
value
} = e.detail
this.setValue(value)
this.triggerEvent('input', {
value
})
},
inputBlur(e) {
this.emit(e)
},
inputConfifm(e) {
this.emit(e)
},
emit(e) {
let {
detail:{
value
},
type
} = e
this.setData({
edit: false
})
this.setValue(value)
this.triggerEvent(type == 'confirm' ? 'search' : 'blur', {
value
})
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="search-box">
<view class="search-input">
<input type="text" maxlength="{{maxlength}}" class="input" value='{{value}}' confirm-type="search" bindinput='input' bindblur="inputBlur" bindconfirm="inputConfifm" placeholder=" {{placeholder||'查找'}}" placeholder-class="placeholder" />
<block wx:if="{{!value}}">
<view class="icon">
<icon type="search" size="14"></icon>
</view>
</block>
</view>
</view>
\ No newline at end of file
/* components/SearchInput/SearchInput.wxss */
.search-box {
height: 104rpx;
border-bottom: 2rpx solid #EBEDF0;
margin: 0 32rpx;
font-size: 28rpx;
padding-top: 16rpx;
box-sizing: border-box;
}
.search-box .search-input {
width: 686rpx;
height: 72rpx;
background: #F7F8FA;
border-radius: 38rpx;
color: #333;
position: relative;
}
.search-input .input {
height: 100%;
width: 100%;
text-align: center;
}
.search-input .icon {
width: 28rpx;
height: 28rpx;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-200%, -50%);
}
.search-input .placeholder {
color: #C8C9CC;
text-align: center;
}
\ No newline at end of file
// components/tabView/tabView.js
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
/**
* 组件的属性列表
*/
properties: {
tabList: {
type: Array,
value: []
},
height: null,
tagIndex: {
type: Number,
value: 0
},
refresherEnabled: Boolean,
triggered: Boolean
},
/**
* 组件的初始数据
*/
data: {
scrollTop: 0,
},
/**
* 组件的方法列表
*/
methods: {
click(e) {
let {
index,
item
} = e.currentTarget.dataset
item.index = index
this.setData({
scrollTop: 0,
tagIndex: index
})
this.triggerEvent('click', item)
},
tabScrollTolower(e) {
this.triggerEvent('tabScrollTolower')
},
viewScrollTolower(e) {
this.triggerEvent('viewScrollTolower')
},
bindrefresherrefresh(e) {
this.triggerEvent('refresherrefresh')
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="tab-box" id="tabView" style="height:calc(100vh - {{height}}px)">
<scroll-view style="height:100%;" scroll-y class="tab" bindscrolltolower="tabScrollTolower">
<view>
<block wx:for="{{tabList}}" wx:key="index">
<view class="tab-item {{tagIndex==index?'active':''}}" bindtap="click" data-item="{{item}}" data-index="{{index}}">
{{item.zoneName}}</view>
</block>
</view>
</scroll-view>
<view class="view">
<view style="height:100%;">
<scroll-view style="height:100%" scroll-y scroll-top="{{scrollTop}}" bindscrolltolower="viewScrollTolower"
refresher-enabled="{{refresherEnabled}}" refresher-triggered="{{triggered}}"
bindrefresherrefresh="bindrefresherrefresh">
<view class="content">
<slot name="content"></slot>
</view>
</scroll-view>
</view>
</view>
</view>
\ No newline at end of file
/* components/tabView/tabView.wxss */
.tab-box{
display: flex;
}
.tab {
width: 21.33%;
box-sizing: border-box;
text-align: center;
background: #F7F8FA ;
}
.view {
width: 78.67%;
height: 100%;
position: relative;
background: #fff;
}
.tab-item {
width: 100%;
height: 120rpx;
line-height: 120rpx;
font-size: 26rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
color: #707071;
box-sizing: border-box;
padding: 0 10rpx;
transition: all .5s;
background-color: #EFF0F2;
}
.active {
font-weight: 500;
background: #fff;
position: sticky;
top: 0;
color: #2D2D2E;
}
.active::after{
position: absolute;
left: 0;
top: 50%;
transform: translateY(-50%);
width: 8rpx;
background-color: var(--btnColor);
content: '';
animation: show-border .5s forwards;
}@keyframes show-border{
0%{
height: 0;
}
100%{
height: 60rpx;
}
}
.refresherEnabled {
position: relative;
top: 0;
left: 0;
width: 100%;
height: 100%;
pointer-events: none;
opacity: 0;
}
.content {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
}
\ No newline at end of file
......@@ -17,11 +17,12 @@ Component({
observer: async function (url, o) {
if (url) {
let isWebp = url.includes('webp')
let checkList = ['https://', 'http://', 'data:image']
let checkList = ['https://', 'http://']
let isFullAdd = checkList.map(item => url.includes(item)).some(item => item)
let isBASE64 = url.includes('data:image')
this.setData({
isWebp,
imagePath: `${isFullAdd ? '' : IMG_URL}${url}` + (isFullAdd ? '' : `?v=${await systemApi.getImageVersion()}`)
imagePath: `${isFullAdd || isBASE64 ? '' : IMG_URL}${url}` + (isBASE64 ? '' : `?v=${await systemApi.getImageVersion()}`)
})
}
}
......
// const kf_list = [{
// sapCode: 5036,
// url: 'https://work.weixin.qq.com/kfid/kfc82ffd378b8649621'
// },
// {
// sapCode: 5028,
// url: 'https://work.weixin.qq.com/kfid/kfcd636da4134201fbb'
// },
// {
// sapCode: 5016,
// url: 'https://work.weixin.qq.com/kfid/kfcdef92056fc8ef091'
// },
// ]
module.exports = Behavior({
data: {},
methods: {
......@@ -35,20 +22,27 @@ module.exports = Behavior({
customerlist
})
},
openKF(e) {
let { kfUrl, widgetStatus } = this.data
async openKF(e) {
let {
kfUrl,
widgetStatus
} = this.data, {
corpId
} = await wx.p.api.systemApi.getMockData()
if (kfUrl)
wx.openCustomerServiceChat({
extInfo: {
url: kfUrl
},
corpId: 'wx51bda2e574d24a91',
corpId,
success(res) {
console.log(res)
},
fail({ errMsg }) {
fail({
errMsg
}) {
console.log(errMsg)
wx.p.wxApi.showToast(errMsg)
wx.p.wxApi.showToast(errMsg)
}
})
else
......@@ -57,4 +51,4 @@ module.exports = Behavior({
})
}
}
})
})
\ No newline at end of file
/* packageEquity/pages/allEquity/allEquity.wxss */
page {
background: #F7F8FA;
background: #F9F7F7;
}
.allEquity-container {
......
......@@ -138,7 +138,7 @@
.sku-box .sku-item .item {
height: 52rpx;
background: #F7F8FA;
background: #F9F7F7;
padding: 0 20rpx;
margin: 20rpx 20rpx 0 0;
font-size: 24rpx;
......
......@@ -21,11 +21,6 @@ Page({
list: [],
pageNum: 1
},
navbarReady(e) {
this.setData({
navBarHeight: e.detail.height
})
},
unique(arr) {
let res = new Set()
return arr.filter(item => {
......
<navigation-bar custom bindnavbarReady="navbarReady" page-title="卡券详情">
<navigation-bar custom page-title="卡券详情">
<view class="navigation">
<view class="back text-center y-center" bindtap="jump">
<glsx-image webp src="mall/back.png" class="icon"></glsx-image>
......@@ -8,7 +8,7 @@
</view>
</view>
</navigation-bar>
<view class="layout isFullSucreen" wx:if="{{couponDetail.couponName}}" style="margin-top: {{navBarHeight}}px;">
<view class="layout isFullSucreen" wx:if="{{couponDetail.couponName}}" style="margin-top: {{navHeight}}px;">
<block wx:if="{{qr}}">
<block wx:if="{{couponDetail.discountType == 3 && couponDetail.useChannel == 1}}">
<view class="coupon-X">
......@@ -141,34 +141,38 @@
<view class="liness" wx:if="{{index < list.length - 1}}"></view>
</block>
</view>
<view class="qr-box box" style="margin-bottom: 32rpx;" wx:if="{{couponDetail.suitMerchantLists && couponDetail.suitMerchantLists.length}}">
<view class="storeTitle">适用门店</view>
<view wx:for="{{couponDetail.suitMerchantLists}}" wx:key="index" class="store-box">
<view class="storeName">{{item.merchantName}}</view>
<view wx:if="{{item.bussinessBegintime}}" class="businessTime">营业时间:{{item.bussinessBegintime}}-{{item.bussinessEndtime}}</view>
<view wx:else class="businessTime">营业时间:无</view>
<view class="line" wx:if="{{item.merchantAddress}}"></view>
<view class="addressBox" wx:if="{{item.merchantAddress}}">
<view style="width: 552rpx;padding-right: 24rpx;">{{item.merchantAddress}}</view>
<view class="navigation" catchtap="jump" data-item="{{item}}">
<glsx-image webp src="mine/icon-go.png"></glsx-image>
<block wx:if="{{couponDetail.suitMerchantLists && couponDetail.suitMerchantLists.length}}">
<view class="qr-box box" style="margin-bottom: 32rpx;">
<view class="storeTitle">适用门店</view>
<view wx:for="{{couponDetail.suitMerchantLists}}" wx:key="index" class="store-box">
<view class="storeName">{{item.merchantName}}</view>
<view wx:if="{{item.bussinessBegintime}}" class="businessTime">营业时间:{{item.bussinessBegintime}}-{{item.bussinessEndtime}}</view>
<view wx:else class="businessTime">营业时间:无</view>
<view class="line" wx:if="{{item.merchantAddress}}"></view>
<view class="addressBox" wx:if="{{item.merchantAddress}}">
<view style="width: 552rpx;padding-right: 24rpx;">{{item.merchantAddress}}</view>
<view class="navigation" catchtap="jump" data-item="{{item}}">
<glsx-image webp src="mine/icon-go.png"></glsx-image>
</view>
</view>
</view>
</view>
</view>
<view wx:else class="qr-box box" style="margin-bottom: 32rpx;">
<view class="storeTitle">适用门店</view>
<view class="storeName">{{couponDetail.merchantName}}</view>
<view wx:if="{{couponDetail.bussinessBegintime}}" class="businessTime">营业时间:{{couponDetail.bussinessBegintime}}-{{couponDetail.bussinessEndtime}}</view>
<view wx:else class="businessTime">营业时间:无</view>
<view class="line" wx:if="{{couponDetail.merchantAddress}}"></view>
<view class="addressBox" wx:if="{{couponDetail.merchantAddress}}">
<view style="width: 552rpx;padding-right: 24rpx;">{{couponDetail.merchantAddress}}</view>
<view class="navigation-X" catchtap="jumpMap">
<glsx-image webp src="mine/{{useMemberType == 0?'navigation':'unNavigation'}}.png"></glsx-image>
</block>
<block wx:else>
<view class="qr-box box" style="margin-bottom: 32rpx;">
<view class="storeTitle">适用门店</view>
<view class="storeName">{{couponDetail.merchantName}}</view>
<view wx:if="{{couponDetail.bussinessBegintime}}" class="businessTime">营业时间:{{couponDetail.bussinessBegintime}}-{{couponDetail.bussinessEndtime}}</view>
<view wx:else class="businessTime">营业时间:无</view>
<view class="line" wx:if="{{couponDetail.merchantAddress}}"></view>
<view class="addressBox" wx:if="{{couponDetail.merchantAddress}}">
<view style="width: 552rpx;padding-right: 24rpx;">{{couponDetail.merchantAddress}}</view>
<view class="navigation-X" catchtap="jumpMap">
<glsx-image webp src="mine/{{useMemberType == 0?'navigation':'unNavigation'}}.png"></glsx-image>
</view>
</view>
</view>
</view>
</block>
<view class="associationBox" wx:if="{{couponDetail.relatedGoodsId}}">
<view class="box-X">
<view class="title">关联商品</view>
......
......@@ -50,7 +50,7 @@ Page({
})
}
},
getUserAddressList() {
getUserAddressList(showTips = '') {
wx.showLoading()
this.setData({
addressList: []
......@@ -60,6 +60,7 @@ Page({
addressList: data
})
wx.hideLoading()
if(showTips) wx.p.wxApi.showToast(showTips)
})
},
chooseDefault(e) {
......@@ -92,7 +93,7 @@ Page({
})
})
} else {
this.getUserAddressList()
this.getUserAddressList('默认地址更新成功')
}
})
},
......
page {
background: #F7F8FA;
background: #F9F7F7;
}
.center-page {
......
......@@ -10,13 +10,13 @@
}
page {
background: #F7F8FA;
background: #F9F7F7;
}
.tab_widget {
width: 100%;
height: 92rpx;
background: #FFFFFF;
background: #F9F7F7;
}
.tab_element {
......
page {
background: #F7F8FA;
background: #F9F7F7;
}
.success_page {
......
......@@ -10,7 +10,7 @@
}
page {
background: #F7F8FA;
background: #F9F7F7;
}
.tab_widget {
......
......@@ -405,7 +405,7 @@ Page({
confirmColor: '#F13C3D',
}).then((res) => {
if (res.confirm) {
equityApi.comfirmRevice(para).then((res) => {
wx.p.api.equityApi.comfirmRevice(para).then((res) => {
wx.p.wxApi.showToast('确认收货成功')
setTimeout(() => {
this.clearData()
......
/* packageMine/pages/order/index/index.wxss */
.sticky-box {
background-color: #fff;
background-color: #F9F7F7;
}
.tab {
......@@ -8,7 +8,7 @@
top: 0;
left: 0;
width: 100%;
background-color: #fff;
background-color: #F9F7F7;
z-index: 2;
transition: all 0.4s;
}
......@@ -38,7 +38,7 @@
left: 80rpx;
width: 420rpx;
height: 72rpx;
background: #f7f8fa;
background: #F9F7F7;
border-radius: 36rpx;
display: flex;
align-items: center;
......
......@@ -66,13 +66,14 @@ Page({
} = await wx.p.api.wechatApi.getSceneById({
id
})
let url = data.scene.split('url=').at(-1)
if (code == 0) this.login({
url
})
const params = data.scene.split('url='),
options = {}
if (params.length > 1) options.url = params.at(-1)
if (code == 0) this.login(options)
else throw {}
} catch (error) {
wx.p.wxApi.showToast(error || '获取scene失败')
this.login()
}
},
jumpPage(val) {
......@@ -81,7 +82,7 @@ Page({
url,
events
} = this.setRouteData(targetPath),
routeName = this.tabList.findIndex(e => `/${e.pagePath}` == `${url}.html`) > -1 ? 'switchTab' : 'redirectTo'
events.notIntercept = true
wx.p.router[routeName](url, events)
......
......@@ -135,12 +135,6 @@ Component({
}
)
},
navbarReady(e) {
let { height } = e.detail
this.setData({
navHeight: height
})
},
// 新版
openMorePack(e) {
const { show } = e.currentTarget.dataset
......
{
"navigationBarTitleText": "权益中心",
"navigationStyle": "custom",
"usingComponents": {
"commodity-item": "/components/commodityItem/index"
}
......
......@@ -2,7 +2,7 @@
/* pages/tab/equity/equity.wxss */
page {
background: white;
background: #F9F7F7;
}
.equity-container {
......
......@@ -119,7 +119,7 @@
bottom: 0;
z-index: 999998;
display: flex;
background: #F7F8FA;
background: #F9F7F7;
border-radius: 0 0 10px 10px;
padding: 0 40rpx;
box-sizing: border-box;
......
......@@ -18,14 +18,6 @@ Page({
onLoad: function (options) {
this.getActivityList()
},
navbarReady(e) {
let {
height
} = e.detail
this.setData({
navHeight: height
})
},
getActivityList() {
wx.p.wxApi.showLoading()
let total = 0
......
<navigation-bar page-title="首页" custom bindnavbarReady="navbarReady" navStyle="background-color: #F9F7F7;">
<navigation-bar page-title="首页" custom >
<view class="home-top flex">
海马刀
<view class="widget-box" bindtap="openKF">
......
......@@ -10,12 +10,7 @@ Component({
},
value: {
type: String,
value: '',
observer(n) {
this.setData({
inputValue: n
})
}
value: ''
},
searchType: {
type: Number,
......@@ -27,7 +22,6 @@ Component({
* 组件的初始数据
*/
data: {
inputValue: ''
},
/**
......@@ -39,18 +33,18 @@ Component({
value
} = e.detail
this.setData({
inputValue:value
value
})
},
blur(e){
let {inputValue} = this.data
let {value} = this.data
this.setData({
inputValue
value
})
},
clear() {
this.setData({
inputValue: ''
value: ''
})
},
confirm(e) {
......
......@@ -4,14 +4,14 @@
<view class="icon box-center">
<icon type="search" size="20"></icon>
</view>
<input type="text" bindinput="input" bindblur="blur" value="{{inputValue}}" placeholder-class="input-placeholder"
<input type="text" bindinput="input" bindblur="blur" value="{{value}}" placeholder-class="input-placeholder"
placeholder="{{placeholder}}" confirm-type="search" class="input" bindconfirm="confirm" />
<block wx:if="{{inputValue}}">
<block wx:if="{{value}}">
<view class="clear-box" bindtap="clear">
<icon type="clear" size="20" class="icon"></icon>
</view>
</block>
</view>
<view class="button box-center" bindtap="search" data-value="{{inputValue}}">搜索</view>
<view class="button box-center" bindtap="search" data-value="{{value}}">搜索</view>
</view>
</view>
\ No newline at end of file
......@@ -3,7 +3,7 @@
height: 104rpx;
box-sizing: border-box;
padding: 0 var(--margin);
background-color: #fff;
background-color: #F9F7F7;
}
.box-center {
......@@ -69,7 +69,7 @@
align-items: center;
width: 592rpx;
height: 100%;
background: #F8F8F8;
background: #fff;
border-radius: 38rpx;
}
......
......@@ -19,7 +19,7 @@
width: 78.67%;
height: 100%;
position: relative;
background: #fff;
background: #F9F7F7;
}
.tab-item {
......
......@@ -9,15 +9,6 @@ Page({
tagIndex: 0,
tabList: []
},
navbarReady(e) {
console.log(e)
let {
height
} = e.detail
this.setData({
navHeight: height,
})
},
search(e) {
let value = e.detail
let {
......@@ -25,7 +16,11 @@ Page({
} = this.data
wx.p.router.go('/packageMall/pages/search/search', {
value,
goodsList
goodsList,
notIntercept: true
})
this.setData({
searchVal:''
})
},
/**
......@@ -186,16 +181,6 @@ Page({
})
this.changeData(index)
},
search(e) {
let value = e.detail
let {
goodsList
} = this.data
wx.p.router.go('/packageMall/pages/search/search', {
value,
goodsList
})
},
/**
* 生命周期函数--监听页面隐藏
*/
......
......@@ -6,6 +6,9 @@
.tab-view-box {
padding: 16rpx var(--margin);
}
.tab-view-box .box{
animation: show-box-opacity .25s forwards;
}
.tab-view-box .banner {
height: 220rpx;
border-radius: 8rpx;
......
<navigation-bar bindnavbarReady="navbarReady">商城</navigation-bar>
<view class="mall-layout" style="margin-top: {{navHeight}}px;">
<search-box search-type="2" bindsearch="search"></search-box>
<search-box search-type="2" bindsearch="search" model:value="{{searchVal}}"></search-box>
<block wx:if="{{flag}}">
<block wx:if="{{tabList.length}}">
<tab-view tabList="{{tabList}}" tagIndex="{{tagIndex}}" height="{{52 + navHeight}}" bindclick="tabclick">
......
......@@ -16,15 +16,15 @@ Page({
url: '/packageMine/pages/address/index/index'
},
],
vipType:{
vipType: {
1: 'gold_vip_bg',
2: 'silver_vip_bg',
3: 'pt_vip_bg'
},
titleClass:{
1:'gold_title',
2:'sliver_title',
3:'card_title',
titleClass: {
1: 'gold_title',
2: 'sliver_title',
3: 'card_title',
},
},
......@@ -66,11 +66,12 @@ Page({
wx.p.router.intercept(false).then(sid => {
if (sid) {
this.setData({
isMember: false
isMember: false,
memberFlag: true
})
} else {
wx.p.api.equityApi.checkOpenMember().then(res => {
console.log(res,'----------')
console.log(res, '----------')
let flag = false,
identity = 0 // 普通会员3 银卡2 金卡1 非会员 0
if (res.data && res.data.validitDate) {
......@@ -85,7 +86,8 @@ Page({
this.setData({
isMember: flag,
vipInfo: res.data,
identity
identity,
memberFlag: true
})
})
}
......
<view class="navigation-bar">
<navigation-bar navStyle="background-color: #F9F7F7;" bindnavbarReady="navbarReady" page-title="会员中心">会员中心</navigation-bar>
<navigation-bar bindnavbarReady="navbarReady" page-title="会员中心">会员中心</navigation-bar>
</view>
<block wx:if="{{user_box_style}}">
<view class="layout mine">
......@@ -37,35 +37,37 @@
</view>
<!-- 会员卡 -->
<block wx:if="{{memberInfo}}">
<block wx:if="{{!isMember}}">
<view class="member-box">
<view class="left-box">
<view class="member-icon">
<glsx-image webp src="mine/member.png"></glsx-image>
</view>
<view class="left-content">
<view class="card">{{memberInfo.equityName}}</view>
<view class="describe" wx:if="{{!isMember}}">生活权益|专享超百项生活权益</view>
<view class="describe" wx:else>{{vipInfo.time}} 到期</view>
<block wx:if="{{memberFlag}}">
<block wx:if="{{!isMember}}">
<view class="member-box">
<view class="left-box">
<view class="member-icon">
<glsx-image webp src="mine/member.png"></glsx-image>
</view>
<view class="left-content">
<view class="card">{{memberInfo.equityName}}</view>
<view class="describe" wx:if="{{!isMember}}">生活权益|专享超百项生活权益</view>
<view class="describe" wx:else>{{vipInfo.time}} 到期</view>
</view>
</view>
<view class="member-button" bindtap="toBuyMember">开通会员</view>
<view class="member-price" bindtap="toBuyMember" wx:if="{{memberInfo.goodPrice}}">特惠¥{{memberInfo.goodPrice}}起</view>
</view>
<view class="member-button" bindtap="toBuyMember">开通会员</view>
<view class="member-price" bindtap="toBuyMember" wx:if="{{memberInfo.goodPrice}}">特惠¥{{memberInfo.goodPrice}}起</view>
</view>
</block>
<block wx:else>
<view class="vip-box" bindtap="goInterests">
<view class="vip-box-bg">
<glsx-image src="equity/version/1_0_0/{{vipType[identity]}}.png"></glsx-image>
</block>
<block wx:else>
<view class="vip-box" bindtap="goInterests">
<view class="vip-box-bg">
<glsx-image src="equity/version/1_0_0/{{vipType[identity]}}.png"></glsx-image>
</view>
<view class="vip-name {{titleClass[identity]}}">{{memberInfo.equityName}}</view>
</view>
<view class="vip-name {{titleClass[identity]}}">{{memberInfo.equityName}}</view>
</view>
<!-- <view class="goUseBox" bindtap="goInterests">
<!-- <view class="goUseBox" bindtap="goInterests">
去使用
<view class="goUseBox-icon">
<glsx-image webp src="mine/goUse.png"></glsx-image>
</view>
</view> -->
</block>
</block>
</block>
<!-- 我的券包 -->
......
......@@ -11,7 +11,7 @@ export function setUserInfo(userInfo) {
export function isMember(isNeedToHttp, callBack) {
if (isNeedToHttp) {
equityApi.checkOpenMember().then(res => {
wx.p.api.equityApi.checkOpenMember().then(res => {
let flag = false
if (res.code == 0 && res.data) {
flag = true
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!